From 0a461a453296874263d1f58713376d3d909175d7 Mon Sep 17 00:00:00 2001 From: "Liu, Xinwu" Date: Thu, 23 May 2019 13:02:34 +0800 Subject: [PATCH] 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 Reviewed-by: Liu, Xiaojing Acked-by: Chen, Gang --- tools/acrn-crashlog/acrnprobe/event_handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/acrn-crashlog/acrnprobe/event_handler.c b/tools/acrn-crashlog/acrnprobe/event_handler.c index 9fa227bed..f6042c93b 100644 --- a/tools/acrn-crashlog/acrnprobe/event_handler.c +++ b/tools/acrn-crashlog/acrnprobe/event_handler.c @@ -177,7 +177,7 @@ static void *event_handle(void *unused __attribute__((unused))) if (e->event_type == VM) { vme = (struct vm_event_t *)e->private; - if (vme->vm_msg) + if (vme && vme->vm_msg) free(vme->vm_msg); if (vme) free(vme);