From a5973bd1d2a15a18b5876a24e368fc042ee78523 Mon Sep 17 00:00:00 2001 From: Thiep Ha Date: Thu, 15 Dec 2016 08:11:43 +0900 Subject: [PATCH] edje_calc: add null checking for strdup Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4488 Change-Id: Ib483d21811f374d165b3cebecc0f7c4cb7642851 --- src/lib/edje/edje_calc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 3e17e23..30ba61d 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -3102,9 +3102,12 @@ _edje_part_recalc_single_filter(Edje *ed, else { char *name = strdup(src1); - name[part - src1] = 0; - efl_gfx_filter_source_set(name, NULL); - free(name); + if (name) + { + name[part - src1] = 0; + efl_gfx_filter_source_set(name, NULL); + free(name); + } } } } @@ -3116,7 +3119,7 @@ _edje_part_recalc_single_filter(Edje *ed, if ((part = strchr(src1, ':')) != NULL) { name = strdup(src1); - name[part - src1] = 0; + if (name) name[part - src1] = 0; part++; } else -- 2.7.4