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; }