]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Ignore HTTP Date values with invalid year (Apple Issue #5724)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 28 Oct 2020 16:40:51 +0000 (12:40 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 28 Oct 2020 16:40:51 +0000 (12:40 -0400)
cups/http-support.c

index 80f2613818b3213f41b1b437c5fd56e16ff7481b..521b7e06bbf95b1aa0cd1691a00eee6e1d4de2e8 100644 (file)
@@ -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.
   */