From: Michael R Sweet Date: Wed, 28 Oct 2020 16:40:51 +0000 (-0400) Subject: Ignore HTTP Date values with invalid year (Apple Issue #5724) X-Git-Tag: v2.3.3op1~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eab918c6ed439a2f6713a0f642a640bf3df80e8d;p=thirdparty%2Fcups.git Ignore HTTP Date values with invalid year (Apple Issue #5724) --- diff --git a/cups/http-support.c b/cups/http-support.c index 80f2613818..521b7e06bb 100644 --- a/cups/http-support.c +++ b/cups/http-support.c @@ -840,6 +840,13 @@ 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) + return (0); + /* * Convert the month name to a number from 0 to 11. */