mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Merge remote-tracking branch 'origin/topic/awelzel/http-content-range-parsing-robustness'
* origin/topic/awelzel/http-content-range-parsing-robustness: HTTP: Make Content-Range parsing more robust
This commit is contained in:
commit
c29b98b224
7 changed files with 48 additions and 3 deletions
|
@ -425,8 +425,14 @@ void HTTP_Entity::SubmitHeader(analyzer::mime::MIME_Header* h)
|
|||
first_byte_pos.c_str(), last_byte_pos.c_str(), instance_length_str.c_str());
|
||||
|
||||
int64_t f, l;
|
||||
util::atoi_n(first_byte_pos.size(), first_byte_pos.c_str(), nullptr, 10, f);
|
||||
util::atoi_n(last_byte_pos.size(), last_byte_pos.c_str(), nullptr, 10, l);
|
||||
int fr = util::atoi_n(first_byte_pos.size(), first_byte_pos.c_str(), nullptr, 10, f);
|
||||
int lr = util::atoi_n(last_byte_pos.size(), last_byte_pos.c_str(), nullptr, 10, l);
|
||||
if ( fr != 1 || lr != 1 )
|
||||
{
|
||||
http_message->Weird("HTTP_content_range_cannot_parse");
|
||||
return;
|
||||
}
|
||||
|
||||
int64_t len = l - f + 1;
|
||||
|
||||
if ( DEBUG_http )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue