1
0
Fork 0
mirror of https://github.com/pygos/usyslog.git synced 2024-05-18 12:06:14 +02:00

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

View file

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