Fix chunk delimiter parsing

This commit is contained in:
Vinnie Falco
2017-06-07 06:57:24 -07:00
parent 96131eb243
commit 60a3221f0b
2 changed files with 7 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ Version 50
* Fields concept work * Fields concept work
* Body documentation work * Body documentation work
* Add missing handler_alloc nested types * Add missing handler_alloc nested types
* Fix chunk delimiter parsing
API Changes: API Changes:

View File

@@ -512,11 +512,16 @@ parse_chunk_header(char const*& p,
// be parsed in one call instead of two. // be parsed in one call instead of two.
if(f_ & flagExpectCRLF) if(f_ & flagExpectCRLF)
{ {
if(n < 2 || ! parse_crlf(p)) if(n < 2)
{ {
ec = error::need_more; ec = error::need_more;
return; return;
} }
if(! parse_crlf(p))
{
ec = error::bad_chunk;
return;
}
f_ &= ~flagExpectCRLF; f_ &= ~flagExpectCRLF;
pbegin += 2; pbegin += 2;
n -= 2; n -= 2;