Skip to content

Commit 0a461a4

Browse files
lauxinwacrnsi
authored andcommitted
tools:acrn-crashlog: fix potential memory corruption
Make sure vm event is not NULL before freeing vm_msg. Tracked-On: #1024 Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com> Reviewed-by: Liu, Xiaojing <xiaojing.liu@intel.com> Acked-by: Chen, Gang <gang.c.chen@intel.com>
1 parent 5a23f7b commit 0a461a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/acrn-crashlog/acrnprobe/event_handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static void *event_handle(void *unused __attribute__((unused)))
177177

178178
if (e->event_type == VM) {
179179
vme = (struct vm_event_t *)e->private;
180-
if (vme->vm_msg)
180+
if (vme && vme->vm_msg)
181181
free(vme->vm_msg);
182182
if (vme)
183183
free(vme);

0 commit comments

Comments
 (0)