summaryrefslogtreecommitdiff
path: root/test/maat_framework_gtest.cpp
diff options
context:
space:
mode:
authorliuwentan <[email protected]>2023-08-11 17:06:22 +0800
committerliuwentan <[email protected]>2023-08-11 17:06:22 +0800
commit8be8f331508e26f294aa2ea3fbda277b907c99f3 (patch)
treeb23993dac9830b60014c4d2441c49b8f166f7935 /test/maat_framework_gtest.cpp
parentd030e5a4524bf7fe7d987e30da1465d0b50c2939 (diff)
[BUGFIX]fix keywords max length 1024v4.0.37
Diffstat (limited to 'test/maat_framework_gtest.cpp')
-rw-r--r--test/maat_framework_gtest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/maat_framework_gtest.cpp b/test/maat_framework_gtest.cpp
index d11c4ff..015faaf 100644
--- a/test/maat_framework_gtest.cpp
+++ b/test/maat_framework_gtest.cpp
@@ -3875,7 +3875,7 @@ void bool_plugin_ex_new_cb(const char *table_name, int table_id, const char *key
ret = get_column_pos(table_line, 3, &column_offset, &column_len);
EXPECT_EQ(ret, 0);
- ud->name = ALLOC(char, column_len+1);
+ ud->name = ALLOC(char, column_len + 1);
memcpy(ud->name, table_line+column_offset, column_len);
ud->name_len = column_len + 1;
@@ -4606,7 +4606,7 @@ TEST_F(MaatFileTest, StreamFiles) {
ASSERT_TRUE(ret == 0);
file_size = file_info.st_size;
- char *buff = ALLOC(char, file_size);
+ char *buff = ALLOC(char, file_size + 1);
FILE *fp = fopen(file_path, "rb");
if (fp == NULL) {
printf("fopen %s error.\n", file_path);
@@ -5655,7 +5655,7 @@ void prepare_file_to_set(const char* filename, char** file_buff, size_t *file_si
ASSERT_FALSE(fp == NULL);
*file_size = file_info.st_size;
- *file_buff = ALLOC(char, *file_size);
+ *file_buff = ALLOC(char, *file_size + 1);
ret = fread(*file_buff, 1, *file_size, fp);
fclose(fp);