summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-06 17:00:38 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-06 17:00:38 +0100
commitb03c0739db10c8b669f9fee47ec74166a06143ed (patch)
treeaf9957dafe645987d0da7d58533a46eee35d7151 /src/modules
parent031e868b65f45770930a018f9582c2e46a0520c8 (diff)
wireless mod - fix out of bound type array accesses
coverity pointed this out. certainly 1403948 is definitely possible if no geometry matches succeed. fix CID 1403948 fix CID 1403944 fix CID 1403928
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/wireless/wireless.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/wireless/wireless.c b/src/modules/wireless/wireless.c
index 30cbf68..1328609 100644
--- a/src/modules/wireless/wireless.c
+++ b/src/modules/wireless/wireless.c
@@ -1005,8 +1005,10 @@ _wireless_gadget_configure_cb(Evas_Object *g)
1005 if (!menu_icon) 1005 if (!menu_icon)
1006 return NULL; 1006 return NULL;
1007 for (type = 0; type < WIRELESS_SERVICE_TYPE_LAST; type++) 1007 for (type = 0; type < WIRELESS_SERVICE_TYPE_LAST; type++)
1008 if (inst->icon[type] == menu_icon) 1008 {
1009 break; 1009 if (inst->icon[type] == menu_icon) break;
1010 }
1011 if (type >= WIRELESS_SERVICE_TYPE_LAST) return NULL;
1010 1012
1011 return _wireless_gadget_edit(type); 1013 return _wireless_gadget_edit(type);
1012} 1014}
@@ -1024,6 +1026,7 @@ _wireless_gadget_menu_populate_cb(Evas_Object *g, E_Menu *m EINA_UNUSED)
1024 evas_object_geometry_get(inst->icon[type], &x, &y, &w, &h); 1026 evas_object_geometry_get(inst->icon[type], &x, &y, &w, &h);
1025 if (E_INSIDE(px, py, x, y, w, h)) break; 1027 if (E_INSIDE(px, py, x, y, w, h)) break;
1026 } 1028 }
1029 if (type >= WIRELESS_SERVICE_TYPE_LAST) return;
1027 menu_icon = inst->icon[type]; 1030 menu_icon = inst->icon[type];
1028} 1031}
1029 1032
@@ -1047,8 +1050,10 @@ _wireless_gadget_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, voi
1047 if (e_desklock_state_get()) return; 1050 if (e_desklock_state_get()) return;
1048 if (auth_popup) return; 1051 if (auth_popup) return;
1049 for (type = 0; type < WIRELESS_SERVICE_TYPE_LAST; type++) 1052 for (type = 0; type < WIRELESS_SERVICE_TYPE_LAST; type++)
1050 if (obj == inst->icon[type]) 1053 {
1051 break; 1054 if (obj == inst->icon[type]) break;
1055 }
1056 if (type >= WIRELESS_SERVICE_TYPE_LAST) return;
1052 if (ev->button == 2) connman_technology_enabled_set(type, !wireless_type_enabled[type]); 1057 if (ev->button == 2) connman_technology_enabled_set(type, !wireless_type_enabled[type]);
1053 if (ev->button != 1) return; 1058 if (ev->button != 1) return;
1054 if (wireless_popup.popup) 1059 if (wireless_popup.popup)