summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-02-06 11:16:20 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-02-06 11:16:20 -0500
commit74dd3ad3873afe3396ed9ec059a3d6a5b77d8bba (patch)
tree396adaeb73425917c83d40f449f972e28e528b2d /src/modules
parentaba428d86c6286d2434107921bd77731562e786c (diff)
resolve even more null derefs from string parsing in vkbd
CID 1132747
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/vkbd/e_kbd_int.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/modules/vkbd/e_kbd_int.c b/src/modules/vkbd/e_kbd_int.c
index 2774704..218f475 100644
--- a/src/modules/vkbd/e_kbd_int.c
+++ b/src/modules/vkbd/e_kbd_int.c
@@ -1032,7 +1032,7 @@ _e_kbd_int_layout_build(E_Kbd_Int *ki)
1032 1032
1033 if (icon) 1033 if (icon)
1034 { 1034 {
1035 char buf[PATH_MAX], *p; 1035 char buf[PATH_MAX];
1036 1036
1037 o2 = e_icon_add(e_comp->evas); 1037 o2 = e_icon_add(e_comp->evas);
1038 e_icon_fill_inside_set(o2, 1); 1038 e_icon_fill_inside_set(o2, 1);
@@ -1042,8 +1042,7 @@ _e_kbd_int_layout_build(E_Kbd_Int *ki)
1042 evas_object_show(o2); 1042 evas_object_show(o2);
1043 1043
1044 snprintf(buf, sizeof(buf), "%s/%s", ki->layout.directory, icon); 1044 snprintf(buf, sizeof(buf), "%s/%s", ki->layout.directory, icon);
1045 p = strrchr(icon, '.'); 1045 if (eina_str_has_extension(icon, ".edj")) e_icon_file_edje_set(o2, buf, "icon");
1046 if (!strcmp(p, ".edj")) e_icon_file_edje_set(o2, buf, "icon");
1047 else e_icon_file_set(o2, buf); 1046 else e_icon_file_set(o2, buf);
1048 } 1047 }
1049 evas_object_grid_pack(ki->layout_obj, o, 1048 evas_object_grid_pack(ki->layout_obj, o,
@@ -1101,7 +1100,7 @@ _e_kbd_int_layouts_list_update(E_Kbd_Int *ki)
1101{ 1100{
1102 Eina_List *files; 1101 Eina_List *files;
1103 Eina_List *l; 1102 Eina_List *l;
1104 char buf[PATH_MAX], *p, *file, *path; 1103 char buf[PATH_MAX], *file, *path;
1105 const char *fl; 1104 const char *fl;
1106 Eina_List *kbs = NULL, *layouts = NULL; 1105 Eina_List *kbs = NULL, *layouts = NULL;
1107 int ok; 1106 int ok;
@@ -1117,8 +1116,7 @@ _e_kbd_int_layouts_list_update(E_Kbd_Int *ki)
1117 1116
1118 EINA_LIST_FREE(files, file) 1117 EINA_LIST_FREE(files, file)
1119 { 1118 {
1120 p = strrchr(file, '.'); 1119 if (eina_str_has_extension(file, ".kbd"))
1121 if ((p) && (!strcmp(p, ".kbd")))
1122 { 1120 {
1123 if (eina_strlcpy(buf + len, file, sizeof(buf) - len) >= 1121 if (eina_strlcpy(buf + len, file, sizeof(buf) - len) >=
1124 sizeof(buf) - len) 1122 sizeof(buf) - len)
@@ -1138,8 +1136,7 @@ _e_kbd_int_layouts_list_update(E_Kbd_Int *ki)
1138 1136
1139 EINA_LIST_FREE(files, file) 1137 EINA_LIST_FREE(files, file)
1140 { 1138 {
1141 p = strrchr(file, '.'); 1139 if (eina_str_has_extension(file, ".kbd"))
1142 if ((p) && (!strcmp(p, ".kbd")))
1143 { 1140 {
1144 ok = 1; 1141 ok = 1;
1145 EINA_LIST_FOREACH(kbs, l, fl) 1142 EINA_LIST_FOREACH(kbs, l, fl)
@@ -1177,7 +1174,7 @@ _e_kbd_int_layouts_list_update(E_Kbd_Int *ki)
1177 s = strdup(ecore_file_file_get(kil->path)); 1174 s = strdup(ecore_file_file_get(kil->path));
1178 if (s) 1175 if (s)
1179 { 1176 {
1180 p = strrchr(s, '.'); 1177 char *p = strrchr(s, '.');
1181 if (p) *p = 0; 1178 if (p) *p = 0;
1182 kil->name = eina_stringshare_add(s); 1179 kil->name = eina_stringshare_add(s);
1183 free(s); 1180 free(s);