From 14e1d9eab9f4b7341f92397a0a9a2706f7b26ee9 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Thu, 3 Nov 2011 22:53:59 +0100 Subject: [PATCH] (url-cookie-expired-p): Protect against zero-length cookie expiry dates. --- lisp/url/ChangeLog | 5 +++++ lisp/url/url-cookie.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 1b6890e5252..a2a1b451258 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,8 @@ +2011-11-03 Lars Magne Ingebrigtsen + + * url-cookie.el (url-cookie-expired-p): Protect against + zero-length cookie expiry dates. + 2011-10-19 Chong Yidong * url-handlers.el (url-handler-mode): Doc fix. diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el index 78afa1633b6..f8417791ce5 100644 --- a/lisp/url/url-cookie.el +++ b/lisp/url/url-cookie.el @@ -156,7 +156,8 @@ telling Microsoft that." (defun url-cookie-expired-p (cookie) "Return non-nil if COOKIE is expired." (let ((exp (url-cookie-expires cookie))) - (and exp (> (float-time) (float-time (date-to-time exp)))))) + (and (> (length exp) 0) + (> (float-time) (float-time (date-to-time exp)))))) (defun url-cookie-retrieve (host &optional localpart secure) "Retrieve all cookies for a specified HOST and LOCALPART." -- 2.39.2