X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fvsprintf.c;h=0fbd0121d91d8eff2e5299650579cd22c6ac9d3e;hb=ba1eb95cf3cc666769afe42eaa15a3a34ae82f94;hp=98d632277ca8c932add9d0daf666dd1795c7f785;hpb=9d7eff608dbccceb3a5168bd240dc6262ae42459;p=linux-2.6-omap-h63xx.git diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 98d632277ca..0fbd0121d91 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -170,6 +170,8 @@ int strict_strtoul(const char *cp, unsigned int base, unsigned long *res) return -EINVAL; val = simple_strtoul(cp, &tail, base); + if (tail == cp) + return -EINVAL; if ((*tail == '\0') || ((len == (size_t)(tail - cp) + 1) && (*tail == '\n'))) { *res = val; @@ -241,6 +243,8 @@ int strict_strtoull(const char *cp, unsigned int base, unsigned long long *res) return -EINVAL; val = simple_strtoull(cp, &tail, base); + if (tail == cp) + return -EINVAL; if ((*tail == '\0') || ((len == (size_t)(tail - cp) + 1) && (*tail == '\n'))) { *res = val;