diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index d1a54df6c..3a14d679e 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -394,9 +394,13 @@ grub_strtoull (const char *str, char **end, int base) if (digit > 9) { digit += '0' - 'a' + 10; - if (digit >= (unsigned long) base) + /* digit <= 9 check is needed to keep chars larger than + '9' but less than 'a' from being read as numbers */ + if (digit >= (unsigned long) base || digit <= 9) break; } + if (digit >= (unsigned long) base) + break; found = 1;