[BusyBox-cvs] busybox/networking ifupdown.c,1.22,1.23

Erik Andersen andersen at codepoet.org
Sat Apr 19 23:15:10 UTC 2003


Update of /var/cvs/busybox/networking
In directory winder:/tmp/cvs-serv23775/networking

Modified Files:
	ifupdown.c 
Log Message:
Patch from David Updegraff to avoid corrupting memory while parsing the
networks/iterfaces file with next_word routine.  Without this, next_word
increments one beyond the end of the string.


Index: ifupdown.c
===================================================================
RCS file: /var/cvs/busybox/networking/ifupdown.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- ifupdown.c	2 Apr 2003 10:13:26 -0000	1.22
+++ ifupdown.c	19 Apr 2003 23:15:06 -0000	1.23
@@ -630,8 +630,11 @@
 		return(NULL);
 	}
 	*buf = word + length;
-	**buf = '\0';
-	(*buf)++;
+	/*DBU:[dave at cray.com] if we are already at EOL dont't increment beyond it */
+	if (**buf) {
+		**buf = '\0';
+		(*buf)++;
+	}
 
 	return word;
 }



More information about the busybox-cvs mailing list