[Nagiosplug-checkins] CVS: nagiosplug/plugins popen.c,1.1.1.1,1.2

Karl DeBisschop kdebisschop at users.sourceforge.net
Sun Oct 6 18:35:02 CEST 2002


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory usw-pr-cvs1:/tmp/cvs-serv32435/plugins

Modified Files:
	popen.c 
Log Message:
make sure we do not run past the end of an unterminated string

Index: popen.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/popen.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** popen.c	28 Feb 2002 06:42:59 -0000	1.1.1.1
--- popen.c	7 Oct 2002 01:34:46 -0000	1.2
***************
*** 303,308 ****
  {
  	int i = 0;
  
! 	while (str != NULL) {
  		if (*(str + i) == *tok) {
  			sprintf (str + i, "%s", "\0");
--- 303,309 ----
  {
  	int i = 0;
+ 	int j = sizeof (str);
  
! 	while (str != NULL && i < j) {
  		if (*(str + i) == *tok) {
  			sprintf (str + i, "%s", "\0");





More information about the Commits mailing list