Check the value given for number-of-logs to keep in config-file entries,
and error-out if the value is negative (avoiding an infinite loop). PR: bin/30654 (part of it) MFC after: 3 weeks
This commit is contained in:
parent
3714896e81
commit
39d0141328
@ -511,8 +511,8 @@ parse_file(char **files)
|
||||
errx(1, "malformed line (missing fields):\n%s",
|
||||
errline);
|
||||
*parse = '\0';
|
||||
if (!sscanf(q, "%d", &working->numlogs))
|
||||
errx(1, "error in config file; bad number:\n%s",
|
||||
if (!sscanf(q, "%d", &working->numlogs) || working->numlogs < 0)
|
||||
errx(1, "error in config file; bad value for count of logs to save:\n%s",
|
||||
errline);
|
||||
|
||||
q = parse = missing_field(sob(++parse), errline);
|
||||
|
Loading…
x
Reference in New Issue
Block a user