From 42e374c23f9b4c967c684751b5f6a3ee90a72f40 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Sat, 27 Apr 2019 14:21:43 -0400 Subject: [PATCH] elc_hoversel: Fix crash when no sd->last_location As we cannot pass NULL to strcmp (crashes when we do), we should check for a valid sd->last_location here in order to avoid crashing. This was detected in Enlightenment Screen Settings dialog by selecting a monitor in the hoversel drop down. @fix --- src/lib/elementary/elc_hoversel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c index 68248aa..6231493 100644 --- a/src/lib/elementary/elc_hoversel.c +++ b/src/lib/elementary/elc_hoversel.c @@ -329,7 +329,7 @@ _sizing_eval(void *data) if (sd->horizontal) { - if (!strcmp(sd->last_location, "left")) + if ((sd->last_location) && (!strcmp(sd->last_location, "left"))) { adjusted.x = parent.x; if ((adjusted.x + adjusted.w) > base.x) @@ -347,7 +347,7 @@ _sizing_eval(void *data) } else { - if (!strcmp(sd->last_location, "top")) + if ((sd->last_location) && (!strcmp(sd->last_location, "top"))) { adjusted.y = parent.y; if ((adjusted.y + adjusted.h) > base.y) -- 2.7.4