|
@@ -170,6 +170,8 @@ int strict_strtoul(const char *cp, unsigned int base, unsigned long *res)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
val = simple_strtoul(cp, &tail, base);
|
|
val = simple_strtoul(cp, &tail, base);
|
|
|
|
+ if (tail == cp)
|
|
|
|
+ return -EINVAL;
|
|
if ((*tail == '\0') ||
|
|
if ((*tail == '\0') ||
|
|
((len == (size_t)(tail - cp) + 1) && (*tail == '\n'))) {
|
|
((len == (size_t)(tail - cp) + 1) && (*tail == '\n'))) {
|
|
*res = val;
|
|
*res = val;
|
|
@@ -241,6 +243,8 @@ int strict_strtoull(const char *cp, unsigned int base, unsigned long long *res)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
val = simple_strtoull(cp, &tail, base);
|
|
val = simple_strtoull(cp, &tail, base);
|
|
|
|
+ if (tail == cp)
|
|
|
|
+ return -EINVAL;
|
|
if ((*tail == '\0') ||
|
|
if ((*tail == '\0') ||
|
|
((len == (size_t)(tail - cp) + 1) && (*tail == '\n'))) {
|
|
((len == (size_t)(tail - cp) + 1) && (*tail == '\n'))) {
|
|
*res = val;
|
|
*res = val;
|