mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-09 02:24:45 +00:00
tools: acrn-crashlog: Fix potential issues under acrnprobe
This patch is to fix potential issues, which are reported by static analysis tool, for acrnprobe. Changes: 1. Check the return value of sender_id() and get_sender_by_name(), since it could be -1 or NULL. 2. Remove the parameter len from create_event, take parameter path as a NULL-terminated string as default. 3. Modify for_each_* functions to avoid 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>
This commit is contained in:
@@ -233,7 +233,7 @@ static struct crash_t *crash_reclassify_by_content(struct crash_t *rcrash,
|
||||
return NULL;
|
||||
|
||||
if (trfile) {
|
||||
ret = read_full_binary_file(trfile, &size, &file);
|
||||
ret = read_file(trfile, &size, &file);
|
||||
if (ret == -1) {
|
||||
LOGE("read %s failed, error (%s)\n",
|
||||
trfile, strerror(errno));
|
||||
|
||||
Reference in New Issue
Block a user