You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/06/16 08:01:26 UTC

[incubator-doris] branch master updated: [Fix] fix vjson_scanner heap use after free when meet object or array type (#10179)

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/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new f49a4535c4 [Fix] fix vjson_scanner heap use after free when meet object or array type (#10179)
f49a4535c4 is described below

commit f49a4535c42d6c679539801c3cfb2047ccf531f9
Author: lihangyu <64...@users.noreply.github.com>
AuthorDate: Thu Jun 16 16:01:18 2022 +0800

    [Fix] fix vjson_scanner heap use after free when meet object or array type (#10179)
    
    quick merge. It is a serious bug in 1.1.
---
 be/src/vec/exec/vjson_scanner.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/be/src/vec/exec/vjson_scanner.cpp b/be/src/vec/exec/vjson_scanner.cpp
index 1acd304e77..d176f7ccdb 100644
--- a/be/src/vec/exec/vjson_scanner.cpp
+++ b/be/src/vec/exec/vjson_scanner.cpp
@@ -284,6 +284,7 @@ Status VJsonReader::_write_data_to_column(rapidjson::Value::ConstValueIterator v
     const char* str_value = nullptr;
     char tmp_buf[128] = {0};
     int32_t wbytes = 0;
+    std::string json_str;
 
     if (slot_desc->is_nullable()) {
         auto* nullable_column = reinterpret_cast<vectorized::ColumnNullable*>(column_ptr);
@@ -331,7 +332,7 @@ Status VJsonReader::_write_data_to_column(rapidjson::Value::ConstValueIterator v
         break;
     default:
         // for other type like array or object. we convert it to string to save
-        std::string json_str = JsonReader::_print_json_value(*value);
+        json_str = JsonReader::_print_json_value(*value);
         wbytes = json_str.size();
         str_value = json_str.c_str();
         break;


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