fix http_stream::handshake2

This commit is contained in:
Pavel Pimenov 2019-12-20 21:15:11 +03:00 committed by Arvid Norberg
parent f0c3eb8915
commit b5bf6c3260
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ namespace libtorrent {
// look for \n\n and \r\n\r\n
// both of which means end of http response header
bool found_end = false;
if (m_buffer[read_pos - 1] == '\n' && read_pos > 2)
if (read_pos > 2 && m_buffer[read_pos - 1] == '\n')
{
if (m_buffer[read_pos - 2] == '\n')
{