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

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


The following commit(s) were added to refs/heads/master by this push:
     new 351fbbc  [fix](olap) add check statement to protect 
get_dict_word_info() from crash (#8241)
351fbbc is described below

commit 351fbbcba58514d9de4b4de761340c2772c82216
Author: zuochunwei <zchw...@qq.com>
AuthorDate: Sat Feb 26 17:05:58 2022 +0800

    [fix](olap) add check statement to protect get_dict_word_info() from crash 
(#8241)
    
    check _num_elems firstly at the beginning of get_dict_word_info for safe
---
 be/src/olap/rowset/segment_v2/binary_plain_page.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/be/src/olap/rowset/segment_v2/binary_plain_page.h 
b/be/src/olap/rowset/segment_v2/binary_plain_page.h
index 2060bd5..061884f 100644
--- a/be/src/olap/rowset/segment_v2/binary_plain_page.h
+++ b/be/src/olap/rowset/segment_v2/binary_plain_page.h
@@ -269,6 +269,8 @@ public:
     }
 
     void get_dict_word_info(StringRef* dict_word_info) {
+        if (_num_elems <= 0) [[unlikely]] return;
+
         char* data_begin = (char*)&_data[0];
         char* offset_ptr = (char*)&_data[_offsets_pos];
 

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to