summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/misc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/misc.c b/lib/misc.c
index b1266e4ba9..9a4f78c093 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -24,6 +24,7 @@
#include <malloc.h>
#include <errno.h>
#include <fs.h>
+#include <linux/ctype.h>
unsigned long strtoul_suffix(const char *str, char **endp, int base)
{
@@ -67,6 +68,9 @@ int parse_area_spec(const char *str, ulong *start, ulong *size)
return 0;
}
+ if (!isdigit(*str))
+ return -1;
+
*start = strtoul_suffix(str, &endp, 0);
str = endp;