diff --git a/app/src/main/cpp/include/sion.h b/app/src/main/cpp/include/sion.h index ebe5715..342f395 100644 --- a/app/src/main/cpp/include/sion.h +++ b/app/src/main/cpp/include/sion.h @@ -454,7 +454,9 @@ namespace sion { private: size_t resp_body_start_pos_ = -1; - String Sourse2Str() { return source_.size() == 0 ? "" : std::string(source_.data(), 0, source_.size()); } + String Sourse2Str() { + return (source_.size() <= 0 || source_.size() >= (1024 * 1024 * 1024)) ? "" : std::string(source_.data(), 0, source_.size()); + } bool CanParseHeader() { auto buf_str = Sourse2Str();