From 47709244d361688d755b805a20af88701be285bf Mon Sep 17 00:00:00 2001 From: arvidn Date: Fri, 22 Dec 2017 23:24:23 +0100 Subject: [PATCH] back-port fixed assert in chunk parser --- src/http_parser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/http_parser.cpp b/src/http_parser.cpp index 52f6152fd..7bac6305b 100644 --- a/src/http_parser.cpp +++ b/src/http_parser.cpp @@ -476,8 +476,9 @@ restart_response: if (*chunk_size != 0) { *header_size = newline - buf.begin; - // the newline alone is two bytes - TORRENT_ASSERT(newline - buf.begin > 2); + // the newline is at least 1 byte, and the length-prefix is at least 1 + // byte + TORRENT_ASSERT(newline - buf.begin >= 2); return true; }