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

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


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new a2b813ffde3 branch-3.0: [fix](be) core dump because of invalid bitmap 
data #53088 (#53934)
a2b813ffde3 is described below

commit a2b813ffde3bdf84beb45869259e2565e2ba2d87
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sun Jul 27 20:32:55 2025 +0800

    branch-3.0: [fix](be) core dump because of invalid bitmap data #53088 
(#53934)
    
    Cherry-picked from #53088
    
    Co-authored-by: JinYang <[email protected]>
---
 be/src/util/bitmap_value.h         | 7 ++++++-
 be/test/util/bitmap_value_test.cpp | 6 ++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/be/src/util/bitmap_value.h b/be/src/util/bitmap_value.h
index 2d15ac99611..e38a5650e0d 100644
--- a/be/src/util/bitmap_value.h
+++ b/be/src/util/bitmap_value.h
@@ -1909,7 +1909,12 @@ public:
         case BitmapTypeCode::BITMAP64_V2:
             _type = BITMAP;
             _is_shared = false;
-            _bitmap = 
std::make_shared<detail::Roaring64Map>(detail::Roaring64Map::read(src));
+            try {
+                _bitmap = 
std::make_shared<detail::Roaring64Map>(detail::Roaring64Map::read(src));
+            } catch (const std::runtime_error& e) {
+                LOG(ERROR) << "Decode roaring bitmap failed, " << e.what();
+                return false;
+            }
             break;
         case BitmapTypeCode::SET: {
             _type = SET;
diff --git a/be/test/util/bitmap_value_test.cpp 
b/be/test/util/bitmap_value_test.cpp
index 2c08161450e..74980ee9091 100644
--- a/be/test/util/bitmap_value_test.cpp
+++ b/be/test/util/bitmap_value_test.cpp
@@ -1188,4 +1188,10 @@ TEST(BitmapValueTest, bitmap_value_iterator_test) {
         }
     }
 }
+
+TEST(BitmapValueTest, invalid_data) {
+    BitmapValue bitmap;
+    char data[] = {0x02, static_cast<char>(0xff), 0x03};
+    EXPECT_FALSE(bitmap.deserialize(data));
+}
 } // namespace doris


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

Reply via email to