From: Lars Magne Ingebrigtsen Date: Thu, 3 Nov 2011 21:53:59 +0000 (+0100) Subject: (url-cookie-expired-p): Protect against zero-length cookie expiry dates. X-Git-Tag: emacs-pretest-24.0.92~225 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=14e1d9eab9f4b7341f92397a0a9a2706f7b26ee9;p=emacs.git (url-cookie-expired-p): Protect against zero-length cookie expiry dates. --- 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."