yhirose 6 years ago
parent
commit
0d81e20129
1 changed files with 2 additions and 0 deletions
  1. 2 0
      httplib.h

+ 2 - 0
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)) {