fix: access address was not malloc (#34971)

issue: #34972  
fix string type data use memcpy to fill cause segv for not malloc enough
memory in advance.

Signed-off-by: lixinguo <xinguo.li@zilliz.com>
Co-authored-by: lixinguo <xinguo.li@zilliz.com>
This commit is contained in:
smellthemoon 2024-07-25 02:31:44 +08:00 committed by GitHub
parent 166fc902b0
commit 7ec9d856f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -390,7 +390,6 @@ TEST(storage, InsertDataStringNullable) {
ASSERT_EQ(new_payload->get_data_type(), storage::DataType::STRING);
ASSERT_EQ(new_payload->get_num_rows(), data.size());
FixedVector<std::string> new_data(data.size());
memcpy(new_data.data(), new_payload->Data(), new_payload->DataSize());
data = {"test1", "test2", "", "", "test5"};
for (int i = 0; i < data.size(); ++i) {
new_data[i] =