david/ipxe
Archived
1
0

[libc] Fix a validation bug in strtoul()

strtoul() was accepting the characters immediately above ASCII 0..9 as
valid hex digits, due to a missing comparison.
This commit is contained in:
Michael Brown 2008-03-18 03:14:05 +00:00
parent 5a08b434c7
commit 6fe585642a

View File

@ -69,7 +69,7 @@ unsigned long strtoul ( const char *p, char **endp, int base ) {
charval = ( charval - 'a' + 10 );
} else if ( charval >= 'A' ) {
charval = ( charval - 'A' + 10 );
} else {
} else if ( charval <= '9' ) {
charval = ( charval - '0' );
}
if ( charval >= ( unsigned int ) base )