From f9defcd94560f24617aa917a754ea4ff70b02dcf Mon Sep 17 00:00:00 2001 From: Lukasz Stanislawski Date: Tue, 20 Oct 2015 11:56:55 +0200 Subject: [PATCH] atspi: fix invalid shift operation. Add additional check in case when Elm_Atspi_Role_Type enum will enlarge. CID: 1325724 --- legacy/elementary/src/lib/elm_atspi_bridge.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/legacy/elementary/src/lib/elm_atspi_bridge.c b/legacy/elementary/src/lib/elm_atspi_bridge.c index c755601031..6019cca77f 100644 --- a/legacy/elementary/src/lib/elm_atspi_bridge.c +++ b/legacy/elementary/src/lib/elm_atspi_bridge.c @@ -2589,7 +2589,7 @@ _collection_match_roles_lookup(Eo *obj, struct collection_match_rule *rule) eo_do(obj, role = elm_interface_atspi_accessible_role_get()); - if (role > 64) + if (role >= 64) { role -= 64; role_set = rule->roles[1]; @@ -2597,6 +2597,12 @@ _collection_match_roles_lookup(Eo *obj, struct collection_match_rule *rule) else role_set = rule->roles[0]; + if (role >= 64) + { + ERR("Elm_Atspi_Role enum value exceeds 127. Unable to compare with roles bit field."); + return EINA_FALSE; + } + switch (rule->rolematchtype) { case ATSPI_Collection_MATCH_INVALID: