[Nagiosplug-checkins] CVS: nagiosplug/plugins check_by_ssh.c,1.8,1.9

Karl DeBisschop kdebisschop at users.sourceforge.net
Tue Jan 28 22:16:06 CET 2003


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv25099/plugins

Modified Files:
	check_by_ssh.c 
Log Message:
fix segfault when argc>=2 and the -H or -b options are not supplied

Index: check_by_ssh.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_by_ssh.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** check_by_ssh.c	16 Jan 2003 05:17:10 -0000	1.8
--- check_by_ssh.c	29 Jan 2003 06:15:32 -0000	1.9
***************
*** 250,259 ****
  			break;
  		case 's':									/* description of service to check */
! 			service = realloc (service, ++services);
  			p1 = optarg;
  			while (p2 = index (p1, ':')) {
  				*p2 = '\0';
  				asprintf (&service[services-1], "%s", p1);
! 				service = realloc (service, ++services);
  				p1 = p2 + 1;
  			}
--- 250,259 ----
  			break;
  		case 's':									/* description of service to check */
! 			service = realloc (service, (++services) * sizeof(char *));
  			p1 = optarg;
  			while (p2 = index (p1, ':')) {
  				*p2 = '\0';
  				asprintf (&service[services-1], "%s", p1);
! 				service = realloc (service, (++services) * sizeof(char *));
  				p1 = p2 + 1;
  			}





More information about the Commits mailing list