DragonFlyBSD Kernel Audit
DF-1027 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/platform/pc64/isa/clock.c b/sys/platform/pc64/isa/clock.c
--- a/sys/platform/pc64/isa/clock.c
+++ b/sys/platform/pc64/isa/clock.c
@@ -1110,6 +1110,8 @@
 		goto wrong_time;
 	}
 	month = readrtc(RTC_MONTH);
+	if (month < 1 || month > 12)
+		goto wrong_time;
 	for (m = 1; m < month; m++)
 		days += daysinmonth[m-1];
 	if ((month > 2) && LEAPYEAR(year))