From 6e616aa97ab932f3f46abfaf445f82858bfd6c15 Mon Sep 17 00:00:00 2001 From: Jiwon Kim Date: Wed, 9 Nov 2016 17:15:35 +0900 Subject: [PATCH] screenshot: Add null check for defending null-dereference issue step: 1. efl_util_screenshot_initialize() failed. 2. But user call efl_util_screenshot_take_tbm_surface() with NULL 3. Null dereference in 1501 line Change-Id: I1e88264b0cd6750a2b7ccd316d2f31ea547d5795 --- src/efl_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/efl_util.c b/src/efl_util.c index 4ad4c79..9d7f1a4 100644 --- a/src/efl_util.c +++ b/src/efl_util.c @@ -1485,7 +1485,7 @@ efl_util_screenshot_take_tbm_surface(efl_util_screenshot_h screenshot) Efl_Util_Wl_Output_Info *output; int ret = 0; - if (screenshot != g_screenshot) + if (!screenshot || (screenshot != g_screenshot)) { set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER); return NULL; -- 2.7.4