elm_theme: more secure check extension as '.edj' and not 'edj'

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12121
This commit is contained in:
Vincent Torri 2020-08-30 20:22:49 +00:00 committed by Stefan Schmidt
parent 4098515779
commit 07d6a25c20
1 changed files with 2 additions and 2 deletions

View File

@ -911,7 +911,7 @@ elm_theme_name_available_list_new(void)
snprintf(buf, sizeof(buf), "%s/"ELEMENTARY_BASE_DIR"/themes/%s", home, file); snprintf(buf, sizeof(buf), "%s/"ELEMENTARY_BASE_DIR"/themes/%s", home, file);
if ((!ecore_file_is_dir(buf)) && (ecore_file_size(buf) > 0)) if ((!ecore_file_is_dir(buf)) && (ecore_file_size(buf) > 0))
{ {
if (eina_str_has_extension(file, "edj")) if (eina_str_has_extension(file, ".edj"))
{ {
th = strdup(file); th = strdup(file);
s = strrchr(th, '.'); s = strrchr(th, '.');
@ -929,7 +929,7 @@ elm_theme_name_available_list_new(void)
snprintf(buf, sizeof(buf), "%s/themes/%s", _elm_data_dir, file); snprintf(buf, sizeof(buf), "%s/themes/%s", _elm_data_dir, file);
if ((!ecore_file_is_dir(buf)) && (ecore_file_size(buf) > 0)) if ((!ecore_file_is_dir(buf)) && (ecore_file_size(buf) > 0))
{ {
if (eina_str_has_extension(file, "edj")) if (eina_str_has_extension(file, ".edj"))
{ {
int dupp; int dupp;