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 1af1dcbde9d branch-3.0: [Bug](function) fix bitmap_from_base64
function cause heap-buffer-overflow error #53018 (#53043)
1af1dcbde9d is described below
commit 1af1dcbde9d97f936530747920e9348ddd0c3404
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Jul 11 09:38:08 2025 +0800
branch-3.0: [Bug](function) fix bitmap_from_base64 function cause
heap-buffer-overflow error #53018 (#53043)
Cherry-picked from #53018
Co-authored-by: zhangstar333 <[email protected]>
---
be/src/vec/functions/function_bitmap.cpp | 4 ++--
.../sql_functions/bitmap_functions/test_bitmap_function.groovy | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/be/src/vec/functions/function_bitmap.cpp
b/be/src/vec/functions/function_bitmap.cpp
index fb0e0471caa..7f8ca009f99 100644
--- a/be/src/vec/functions/function_bitmap.cpp
+++ b/be/src/vec/functions/function_bitmap.cpp
@@ -289,8 +289,8 @@ struct BitmapFromBase64 {
} else {
BitmapValue bitmap_val;
if (!bitmap_val.deserialize(decode_buff.data())) {
- return Status::RuntimeError(
- fmt::format("bitmap_from_base64 decode failed:
base64: {}", src_str));
+ return Status::RuntimeError("bitmap_from_base64 decode
failed: base64: {}",
+ std::string(src_str,
src_size));
}
res.emplace_back(std::move(bitmap_val));
}
diff --git
a/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy
b/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy
index 523cfc0a0cd..5be83b29aa3 100644
---
a/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy
+++
b/regression-test/suites/query_p0/sql_functions/bitmap_functions/test_bitmap_function.groovy
@@ -927,4 +927,9 @@ suite("test_bitmap_function") {
// BITMAP_FROM_ARRAY
sql """ set experimental_enable_nereids_planner=true; """
qt_sql """ select bitmap_to_string(BITMAP_FROM_ARRAY([]));"""
+
+ test {
+ sql """ SELECT bitmap_from_base64('CQoL') AS result; """
+ exception "bitmap_from_base64 decode failed"
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]