diff --git a/cups/http-support.c b/cups/http-support.c index dfdfb1063..599f696ed 100644 --- a/cups/http-support.c +++ b/cups/http-support.c @@ -772,7 +772,10 @@ httpGetDateTime(const char *s) // I - Date/time string DEBUG_printf("4httpGetDateTime: day=%d, mon=\"%s\", year=%d, hour=%d, min=%d, sec=%d", day, mon, year, hour, min, sec); // Check for invalid year (RFC 7231 says it's 4DIGIT) - if (year > 9999) + if (year < 0 || year > 9999) + return (0); + + if (day < 1 || day > 31 || hour < 0 || hour > 23 || min < 0 || min > 59 || sec < 0 || sec > 60) return (0); // Convert the month name to a number from 0 to 11.