diff --git a/src/runtime/http/v1/parser.cpp b/src/runtime/http/v1/parser.cpp index 115967c..a7fbc01 100644 --- a/src/runtime/http/v1/parser.cpp +++ b/src/runtime/http/v1/parser.cpp @@ -345,7 +345,7 @@ ParseResult Parser::FeedChunkSize() { state_ = State::Trailers; return ParseResult::NeedMore; } - if (body_.size() + size > body_cap_) { + if (body_.size() > body_cap_ || size > body_cap_ - body_.size()) { state_ = State::Failed; return ParseResult::Error413; }