From 308cc448e5d6ffd44c7ff366a99d34bbfb0e8c4d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 3 Aug 2014 08:38:52 -0700 Subject: Don't mishandle year-9999 dates. * lisp/calendar/parse-time.el (parse-time-rules): Allow years up to most-positive-fixnum. * lisp/calendar/time-date.el (date-to-time): Pass "Specified time is not representable" errors through. * lisp/url/url-cookie.el (url-cookie-expired-p): Treat out-of-range expiration dates as if they were far in the future. * src/editfns.c (decode_time_components): Store an invalid timespec on overflow, instead of returning false, so that the caller can distinguish overflow from other errors. (lisp_time_argument, lisp_seconds_argument): If the time is out of range, signal a time overflow instead of an invalid time spec. * src/keyboard.c (decode_timer): Treat time overflow like other timespec errors. Fixes: debbugs:18176 --- lisp/url/url-cookie.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/url/url-cookie.el') diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el index 55e0fb33951..f89886b95dd 100644 --- a/lisp/url/url-cookie.el +++ b/lisp/url/url-cookie.el @@ -158,7 +158,9 @@ telling Microsoft that." "Return non-nil if COOKIE is expired." (let ((exp (url-cookie-expires cookie))) (and (> (length exp) 0) - (> (float-time) (float-time (date-to-time exp)))))) + (condition-case () + (> (float-time) (float-time (date-to-time exp))) + (error nil))))) (defun url-cookie-retrieve (host &optional localpart secure) "Retrieve all cookies for a specified HOST and LOCALPART." -- cgit v1.2.1