diff options
author | Michael Brown | 2008-03-18 04:14:05 +0100 |
---|---|---|
committer | Michael Brown | 2008-03-18 04:14:05 +0100 |
commit | 6fe585642a79c071ed3657547acc9d4133c7abf8 (patch) | |
tree | e3195ffa8e7428a2c6afc9e888d9320101eb02b2 /src/core/misc.c | |
parent | [Settings] show_setting() functions return snprintf()-style length. (diff) | |
download | ipxe-6fe585642a79c071ed3657547acc9d4133c7abf8.tar.gz ipxe-6fe585642a79c071ed3657547acc9d4133c7abf8.tar.xz ipxe-6fe585642a79c071ed3657547acc9d4133c7abf8.zip |
[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.
Diffstat (limited to 'src/core/misc.c')
-rw-r--r-- | src/core/misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/misc.c b/src/core/misc.c index a54f5a10..1f51272d 100644 --- a/src/core/misc.c +++ b/src/core/misc.c @@ -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 ) |