From 0d81e2012904d444af1de166f8e15b60c505cea6 Mon Sep 17 00:00:00 2001 From: yhirose Date: Tue, 14 Jan 2020 14:59:20 -0500 Subject: [PATCH] Fix #332 --- httplib.h | 2 ++ 1 file changed, 2 insertions(+) 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)) {