mirror of
https://github.com/pygos/usyslog.git
synced 2024-11-17 02:07:11 +01:00
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
1 changed files with 2 additions and 0 deletions
2
proto.c
2
proto.c
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue