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.
This commit is contained in:
Marcel Hollerbach 2017-01-02 17:18:31 +01:00
parent 4fddc11e64
commit a56a957235
1 changed files with 2 additions and 1 deletions

View File

@ -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());