mirror of https://github.com/pygos/usyslog.git
Add extra bounds check to syslog message parser
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
parent
efa304b483
commit
5fcb1a06cb
2
proto.c
2
proto.c
|
@ -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];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue