Add extra bounds check to syslog message parser

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-10-29 15:17:36 +01:00
parent efa304b483
commit 5fcb1a06cb
1 changed files with 2 additions and 0 deletions

View File

@ -21,6 +21,8 @@ static int isleap(int year)
static int mdays(int year, int month)
{
if (month < 1 || month > 12)
return 0;
return (isleap(year) && month == 2) ? 29 : days[month - 1];
}