[BusyBox-cvs] busybox/modutils modprobe.c,1.30,1.31

Erik Andersen andersen at busybox.net
Tue Apr 6 12:06:06 UTC 2004


Update of /var/cvs/busybox/modutils
In directory nail:/tmp/cvs-serv15024/modutils

Modified Files:
	modprobe.c 
Log Message:
Michael Tokarev, mjt at tls dot msk dot ru writes:

Fix parsing of all tag-value pairs (in modules.conf in particular).
Without this fix, code chokes badly on lines where either value or
both tag+value are missing, like bare
 alias
line, or alias w/o the value like
 alias some-module
(syntactically incorrect, but no need for coredumps either).



Index: modprobe.c
===================================================================
RCS file: /var/cvs/busybox/modutils/modprobe.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- a/modprobe.c	6 Apr 2004 12:05:04 -0000	1.30
+++ b/modprobe.c	6 Apr 2004 12:06:03 -0000	1.31
@@ -67,15 +67,17 @@
 		buffer++;
 	tag = value = buffer;
 	while ( !isspace ( *value ))
-		value++;
+		if (!*value) return 0;
+		else value++;
 	*value++ = 0;
 	while ( isspace ( *value ))
 		value++;
+	if (!*value) return 0;
 
 	*ptag = tag;
 	*pvalue = value;
 
-	return bb_strlen( tag ) && bb_strlen( value );
+	return 1;
 }
 
 /* Jump through hoops to simulate how fgets() grabs just one line at a




More information about the busybox-cvs mailing list