back-port fixed assert in chunk parser

This commit is contained in:
arvidn 2017-12-22 23:24:23 +01:00 committed by Arvid Norberg
parent 62bf524e75
commit 47709244d3
1 changed files with 3 additions and 2 deletions

View File

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