mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-04 23:50:27 +00:00
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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111400
|
@ -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…
Reference in a new issue