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

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


The following commit(s) were added to refs/heads/master by this push:
     new fbe529b0752 [fix] add null check before accessing pointer (#38817)
fbe529b0752 is described below

commit fbe529b07525a4da2ffd19e623992701e2a74d50
Author: Vallish Pai <[email protected]>
AuthorDate: Mon Aug 5 07:20:20 2024 +0530

    [fix] add null check before accessing pointer (#38817)
    
    ## Proposed changes
    
    Issue Number: close #xxx
    
    re2_ptr can possible null from code review.
    fixed code to handle it.
---
 be/src/vec/functions/function_split_by_regexp.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/be/src/vec/functions/function_split_by_regexp.cpp 
b/be/src/vec/functions/function_split_by_regexp.cpp
index 40628ee2017..cee2e186b57 100644
--- a/be/src/vec/functions/function_split_by_regexp.cpp
+++ b/be/src/vec/functions/function_split_by_regexp.cpp
@@ -247,7 +247,7 @@ private:
         if (pattern_ref.size) {
             re2_ptr = std::make_unique<re2::RE2>(pattern_ref.to_string_view(), 
*opts);
         }
-        if (!re2_ptr->ok()) {
+        if ((re2_ptr == nullptr) || (!re2_ptr->ok())) {
             return Status::RuntimeError("Invalid pattern: {}", 
pattern_ref.debug_string());
         }
         RegexpSplit RegexpSplit;


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

Reply via email to