mirror of
https://github.com/shadow-maint/shadow.git
synced 2024-11-27 03:53:59 +08:00
lib/getrange.c: getrange(): Report an error when min>max
Cc: Serge Hallyn <serge@hallyn.com> Cc: Iker Pedrosa <ipedrosa@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
parent
29f135777e
commit
0066743c49
@ -33,6 +33,7 @@ getrange(const char *range,
|
||||
if (NULL == range)
|
||||
return -1;
|
||||
|
||||
*min = 0;
|
||||
*has_min = false;
|
||||
*has_max = false;
|
||||
|
||||
@ -58,7 +59,7 @@ parse_max:
|
||||
if (!isdigit((unsigned char) *end))
|
||||
return -1;
|
||||
|
||||
if (a2ul(max, end, NULL, 10, 0, ULONG_MAX) == -1)
|
||||
if (a2ul(max, end, NULL, 10, *min, ULONG_MAX) == -1)
|
||||
return -1;
|
||||
*has_max = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user