public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.4.20: lib/vsprintf.c: Fix vsscanf of hex digits
@ 2003-01-31 21:15 Kevin Corry
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Corry @ 2003-01-31 21:15 UTC (permalink / raw)
  To: Marcelo Tosatti, Alan Cox; +Cc: LKML

Hi,

The current vsscanf() in 2.4 does not correctly scan hex digits that begin 
with a-f. (It does work correctly for hex digits that begin with 0-9). This 
patch fixes that bug, and is based on the fix that was added to 2.5.

-- 
Kevin Corry
corryk@us.ibm.com
http://evms.sourceforge.net/


--- linux-2.4.20a/lib/vsprintf.c	Tue Jan 21 11:12:02 2003
+++ linux-2.4.20b/lib/vsprintf.c	Tue Jan 21 11:11:49 2003
@@ -637,7 +637,11 @@
 		while (isspace(*str))
 			str++;
 
-		if (!*str || !isdigit(*str))
+		if (!*str
+		    || (base == 16 && !isxdigit(*str))
+		    || (base == 10 && !isdigit(*str))
+		    || (base == 8 && (!isdigit(*str) || *str > '7'))
+		    || (base == 0 && !isdigit(*str)))
 			break;
 
 		switch(qualifier) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] 2.4.20: lib/vsprintf.c: Fix vsscanf of hex digits
@ 2003-03-05 15:31 Kevin Corry
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Corry @ 2003-03-05 15:31 UTC (permalink / raw)
  To: Marcelo Tosatti, Alan Cox; +Cc: LKML

Hi,

The current vsscanf() in 2.4 does not correctly scan hex digits that begin 
with a-f. (It does work correctly for hex digits that begin with 0-9). This 
patch fixes that bug, and is based on the fix that was added to 2.5.

-- 
Kevin Corry
corryk@us.ibm.com
http://evms.sourceforge.net/


--- linux-2.4.20a/lib/vsprintf.c	Tue Jan 21 11:12:02 2003
+++ linux-2.4.20b/lib/vsprintf.c	Tue Jan 21 11:11:49 2003
@@ -637,7 +637,11 @@
 		while (isspace(*str))
 			str++;
 
-		if (!*str || !isdigit(*str))
+		if (!*str
+		    || (base == 16 && !isxdigit(*str))
+		    || (base == 10 && !isdigit(*str))
+		    || (base == 8 && (!isdigit(*str) || *str > '7'))
+		    || (base == 0 && !isdigit(*str)))
 			break;
 
 		switch(qualifier) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-05 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-05 15:31 [PATCH] 2.4.20: lib/vsprintf.c: Fix vsscanf of hex digits Kevin Corry
  -- strict thread matches above, loose matches on Subject: below --
2003-01-31 21:15 Kevin Corry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox