(url-cookie-host-can-set-p): Protect against zero-length domains
commit62523863780d3894c92f84dd474278eeddc4a0e0
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 7 Jun 2017 14:17:47 +0000 (7 16:17 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 7 Jun 2017 14:17:47 +0000 (7 16:17 +0200)
tree06ba1867972acaaa0cdb15d226882c573a158836
parent43885eac09d7c69ecbac08c033d33381e21f48a2
(url-cookie-host-can-set-p): Protect against zero-length domains

* lisp/url/url-cookie.el (url-cookie-host-can-set-p): Protect
against zero-length domains.

Backtrace of a real-world site that triggers a bug:

Debugger entered--Lisp error: (args-out-of-range "" 0)
  url-cookie-host-can-set-p("www.washingtonpost.com" "")
  url-cookie-handle-set-cookie("utm_term=0;Expires=Thursday,
  01-January-1970 00:00:00 GMT; path=/; domain=")
  url-http-handle-cookies()
lisp/url/url-cookie.el