[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 4f1df40 2/2: Fix obscure HTTP chunked parsing probl
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 4f1df40 2/2: Fix obscure HTTP chunked parsing problem |
Date: |
Wed, 15 May 2019 01:12:44 -0400 (EDT) |
branch: master
commit 4f1df40db36b221e7842bd75d6281922dcb268ee
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Fix obscure HTTP chunked parsing problem
* lisp/url/url-http.el
(url-http-chunked-encoding-after-change-function): Ensure that we
parse the entire initial chunked header as the length (bug#35658).
---
lisp/url/url-http.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 03b863b..48e2998 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -1084,6 +1084,12 @@ the end of the document."
;; need to spin some more.
(url-http-debug "Did not see start of chunk @ %d!" (point))
(setq read-next-chunk nil))
+ ;; The data we got may have started in the middle of the
+ ;; initial chunk header, so move back to the start of the
+ ;; line and re-compute.
+ (when (= url-http-chunked-counter 0)
+ (beginning-of-line)
+ (looking-at regexp))
(add-text-properties (match-beginning 0) (match-end 0)
(list 'start-open t
'end-open t