Fix parse illegal characters in obs-fold

This commit is contained in:
Vinnie Falco
2017-07-20 08:15:30 -07:00
parent f657057c49
commit a00ce1209b
3 changed files with 41 additions and 0 deletions
+1
View File
@@ -8,6 +8,7 @@ Version 76:
* Serializer members are not const
* serializing file_body is not const
* Add file_body_win32
* Fix parse illegal characters in obs-fold
API Changes:
@@ -797,6 +797,11 @@ protected:
p = parse_token_to_eol(p, last, token_last, ec);
if(ec)
return;
if(! p)
{
ec = error::bad_value;
return;
}
// Look 1 char past the CRLF to handle obs-fold.
if(p + 1 > last)
{
+35
View File
@@ -1103,6 +1103,40 @@ public:
//--------------------------------------------------------------------------
void
testFuzz1()
{
error_code ec;
test_parser<true> p;
feed(buf(
"LOCK /%e7lY;/;;%0b8=p/r HTTP/1.1\r\n"
"Accept-Encoding:\r\n"
" î\r\n"
"Original-Message-ID:ë ÿÿÿÿÿÿÿÿ: \r\n"
" ÷D›¥Ÿ\r\n"
"Resent-Date:ô\r\n"
"Alt-Svc: \r\n"
"Trailer: \r\n"
"List-ID:¦k† \r\n"
"Alternate-Recipient:óã\"�ïû„qJ̼–÷[rñò\r\n"
"Location: \r\n"
"Accept-Additions: \r\n"
"MMHS-Originator-PLAD: \r\n"
"Original-Sender: \r\n"
"Original-Sender:\r\n"
"PICS-Label:\r\n"
" \r\n"
"If: @ÁP\\ÖÆü�\\|–E\r\n"
"MMHS-Exempted-Address:\r\n"
"Injection-Info: \r\n"
"Contetn-Length: 0\r\n"
"\r\n"
), p, ec);
BEAST_EXPECT(ec);
}
//--------------------------------------------------------------------------
void
run() override
{
@@ -1122,6 +1156,7 @@ public:
testIssue430();
testIssue452();
testIssue496();
testFuzz1();
}
};