This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.1 by this push:
     new 9769856fda5 branch-4.1: [fix](be) Validate stream load content length 
before group commit #62110 (#62592)
9769856fda5 is described below

commit 9769856fda5b8253842210e47aa3fc7805efbdcf
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Apr 20 12:32:40 2026 +0800

    branch-4.1: [fix](be) Validate stream load content length before group 
commit #62110 (#62592)
    
    Cherry-picked from #62110
    
    Co-authored-by: Xin Liao <[email protected]>
---
 be/src/service/http/action/stream_load.cpp | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/be/src/service/http/action/stream_load.cpp 
b/be/src/service/http/action/stream_load.cpp
index 3c4ccd74f1a..ee3febc134d 100644
--- a/be/src/service/http/action/stream_load.cpp
+++ b/be/src/service/http/action/stream_load.cpp
@@ -881,9 +881,16 @@ Status StreamLoadAction::_check_wal_space(const 
std::string& group_commit_mode,
 Status StreamLoadAction::_can_group_commit(HttpRequest* req, 
std::shared_ptr<StreamLoadContext> ctx,
                                            std::string& group_commit_header,
                                            bool& can_group_commit) {
-    int64_t content_length = req->header(HttpHeaders::CONTENT_LENGTH).empty()
-                                     ? 0
-                                     : 
std::stoll(req->header(HttpHeaders::CONTENT_LENGTH));
+    int64_t content_length = 0;
+    const auto& content_length_str = req->header(HttpHeaders::CONTENT_LENGTH);
+    if (!content_length_str.empty()) {
+        try {
+            content_length = std::stoll(content_length_str);
+        } catch (const std::exception& e) {
+            return Status::InvalidArgument("invalid HTTP header 
CONTENT_LENGTH={}: {}",
+                                           content_length_str, e.what());
+        }
+    }
     if (content_length < 0) {
         std::stringstream ss;
         ss << "This stream load content length <0 (" << content_length


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to