From 099717a3d82bdebd8653fdb7c6d2ca11bd113323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=98=95?= Date: Fri, 6 Dec 2024 14:51:04 +0800 Subject: [PATCH] =?UTF-8?q?OCT=201.=20=E6=9B=B4=E6=96=B0SCG=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/include/sion.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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();