BUG/MINOR: tools: Reject size format not starting by a digit

parse_size_err() function is now more strict on the size format. The first
character must be a digit. Otherwise an error is returned. Thus "size k" is
now rejected.

This patch must be backported to all stable versions.
This commit is contained in:
Christopher Faulet 2020-12-11 09:30:45 +01:00
parent c20ad0d8db
commit 82635a0fc1

View File

@ -2304,6 +2304,9 @@ const char *parse_time_err(const char *text, unsigned *ret, unsigned unit_flags)
const char *parse_size_err(const char *text, unsigned *ret) {
unsigned value = 0;
if (!isdigit((unsigned char)*text))
return text;
while (1) {
unsigned int j;