From a56a957235ea897fb03cbccc747e7ae9c494678f Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Mon, 2 Jan 2017 17:18:31 +0100 Subject: [PATCH] elementary_config: make compare of web_backend more secure web_backend can get NULL when there is a error with the entry. Make sure the pointers are different, or they are not NULL and the string contents are different. --- src/bin/elementary/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/elementary/config.c b/src/bin/elementary/config.c index 208057f0d3..7fbad413a8 100644 --- a/src/bin/elementary/config.c +++ b/src/bin/elementary/config.c @@ -4346,7 +4346,8 @@ elm_main(int argc, web_backend = elm_object_text_get(web_backend_entry); fprintf(stderr, "[%s] vs [%s]\n", web_backend, web_backend_set); - if (strcmp(web_backend, web_backend_set)) + if (web_backend_set != web_backend || + (web_backend && web_backend_set && !!strcmp(web_backend, web_backend_set))) { elm_config_web_backend_set(web_backend); fprintf(stderr, "web backend set to : [%s]\n", elm_config_web_backend_get());