utils: check suffix length

parent 99eafdd4
...@@ -2412,10 +2412,10 @@ int parse_byte_size_string(const char *s, int64_t *converted) ...@@ -2412,10 +2412,10 @@ int parse_byte_size_string(const char *s, int64_t *converted)
else else
return -EINVAL; return -EINVAL;
if ((end - 2) == dup && !isdigit(*(end - 2))) if (suffix_len > 0 && (end - 2) == dup && !isdigit(*(end - 2)))
return -EINVAL; return -EINVAL;
if (isalpha(*(end - 2))) { if (suffix_len > 0 && isalpha(*(end - 2))) {
if (suffix_len == 1) if (suffix_len == 1)
suffix_len++; suffix_len++;
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment