diff --git a/httplib.h b/httplib.h index a9613d1..7577118 100644 --- a/httplib.h +++ b/httplib.h @@ -2157,6 +2157,8 @@ public: case 3: { // Body { auto pattern = crlf_ + dash_; + if (pattern.size() > buf_.size()) { return true; } + auto pos = buf_.find(pattern); if (pos == std::string::npos) { pos = buf_.size(); } if (!content_callback(buf_.data(), pos)) {