From 5fcb1a06cb4b560fee6d1a9c676852bd8f67a9b2 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 29 Oct 2018 15:17:36 +0100 Subject: [PATCH] Add extra bounds check to syslog message parser Signed-off-by: David Oberhollenzer --- proto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proto.c b/proto.c index acbc251..5f1c03e 100644 --- a/proto.c +++ b/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]; }