Skip to content

Commit 0c39b9c

Browse files
xiaojingrichlijinxia
authored andcommitted
tools: acrn-crashlog: Fix potential issues for load_conf module of acrnprobe
This patch is to fix potential issues, which are reported by static analysis tool, for load_conf module of acrnprobe. Changes: 1. Check the range of id while loading configuration, to avoid memory corruption. 2. Use strncpy instead of strcpy to avoid buf overflow. Signed-off-by: Liu Xinwu <xinwu.liu@intel.com> Reviewed-by: Zhi Jin <zhi.jin@intel.com> Acked-by: Chen Gang <gang.c.chen@intel.com>
1 parent b3ca8f4 commit 0c39b9c

File tree

3 files changed

+220
-83
lines changed

3 files changed

+220
-83
lines changed

tools/acrn-crashlog/acrnprobe/include/load_conf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ struct conf_t conf;
200200
}) \
201201
)
202202

203-
int load_conf(char *path);
203+
int load_conf(const char *path);
204204
struct trigger_t *get_trigger_by_name(char *name);
205205
struct log_t *get_log_by_name(char *name);
206206
int sender_id(struct sender_t *sender);

0 commit comments

Comments
 (0)