(url-cookie-expired-p): Protect against zero-length cookie expiry dates.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 3 Nov 2011 21:53:59 +0000 (22:53 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 3 Nov 2011 21:53:59 +0000 (22:53 +0100)
lisp/url/ChangeLog
lisp/url/url-cookie.el

index 1b6890e..a2a1b45 100644 (file)
@@ -1,3 +1,8 @@
+2011-11-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * url-cookie.el (url-cookie-expired-p): Protect against
+       zero-length cookie expiry dates.
+
 2011-10-19  Chong Yidong  <cyd@gnu.org>
 
        * url-handlers.el (url-handler-mode): Doc fix.
index 78afa16..f841779 100644 (file)
@@ -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."