mirror of
https://github.com/rfc1036/whois.git
synced 2026-08-01 07:20:13 +00:00
mkpasswd: fix an underflow in the parser for -R
Reported by mahkoh on github: https://github.com/rfc1036/whois/issues/12
This commit is contained in:
parent
d053b2f1f6
commit
366ca9bcbe
@ -179,11 +179,14 @@ int main(int argc, char *argv[])
|
||||
case 'R':
|
||||
{
|
||||
char *p;
|
||||
rounds = strtol(optarg, &p, 10);
|
||||
if (p == NULL || *p != '\0' || rounds < 0) {
|
||||
long r;
|
||||
|
||||
r = strtol(optarg, &p, 10);
|
||||
if (p == NULL || *p != '\0' || r < 0) {
|
||||
fprintf(stderr, _("Invalid number '%s'.\n"), optarg);
|
||||
exit(1);
|
||||
}
|
||||
rounds = r;
|
||||
}
|
||||
break;
|
||||
case 's':
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user