bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37974: eww produces "error in process filter: Specified time is not


From: Lars Ingebrigtsen
Subject: bug#37974: eww produces "error in process filter: Specified time is not representable"
Date: Tue, 29 Oct 2019 22:52:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

"A.C." <achirvasub@gmail.com> writes:

>>In any case, Emacs 27 has bignum support, so this should hopefully not
>>be a problem any more. Can you try the test case with the current
>>Emacs
>>trunk and see whether it's still present?
>
> That will be tough. This 32-bit machine overheats something fierce; I
> doubt I can even clone the git repo without it dying, let alone
> compile.

Testing a bit more, the bug is present even on 64-bits systems.

While this works:

(format-time-string "%a %b %d %H:%M:%S %Y GMT" 9460800000000000 t)
=> "Wed Apr 08 00:00:00 299802787 GMT"

(format-time-string "%a %b %d %H:%M:%S %Y GMT" 94608000000000000 t)

errors out with

"Specified time is not representable"

Test case:

(url-cookie-handle-set-cookie "browser=68.133.6.220.1572324160979722; path=/; 
max-age=946080000000000000; domain=.arxiv.org")

The input is completely controlled by the server, of course, and bogus
data may appear in the cookie, and the URL library should protect
against this, so I've now made it ignore these errors in Emacs 27.  This
patch may also apply to the version of Emacs you're using; I haven't
checked.

diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el
index 31fc3e7266..740a43fa16 100644
--- a/lisp/url/url-cookie.el
+++ b/lisp/url/url-cookie.el
@@ -304,9 +304,10 @@ url-cookie-handle-set-cookie
                         (url-filename url-current-object))))
         (expires nil))
     (if (and max-age (string-match "\\`-?[0-9]+\\'" max-age))
-       (setq expires (format-time-string "%a %b %d %H:%M:%S %Y GMT"
-                                         (time-add nil (read max-age))
-                                         t))
+       (setq expires (ignore-errors
+                        (format-time-string "%a %b %d %H:%M:%S %Y GMT"
+                                           (time-add nil (read max-age))
+                                           t)))
       (setq expires (cdr-safe (assoc-string "expires" args t))))
     (while (consp trusted)
       (if (string-match (car trusted) current-url)


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]