utils: check suffix length

parent 99eafdd4
......@@ -2412,10 +2412,10 @@ int parse_byte_size_string(const char *s, int64_t *converted)
else
return -EINVAL;
if ((end - 2) == dup && !isdigit(*(end - 2)))
if (suffix_len > 0 && (end - 2) == dup && !isdigit(*(end - 2)))
return -EINVAL;
if (isalpha(*(end - 2))) {
if (suffix_len > 0 && isalpha(*(end - 2))) {
if (suffix_len == 1)
suffix_len++;
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