diff options
author | Lukasz Stanislawski <l.stanislaws@samsung.com> | 2015-10-20 11:56:55 +0200 |
---|---|---|
committer | Lukasz Stanislawski <l.stanislaws@samsung.com> | 2015-10-20 12:00:08 +0200 |
commit | ec69c39e6965c7d0a9fa2f4d09f87af2ad0f8822 (patch) | |
tree | 61e48fb8a0b092233f581ba208d5c3b6ac007f8a | |
parent | 04c553525086fd212c8a27e38c135a27cba42ba0 (diff) | |
download | elementary-ec69c39e6965c7d0a9fa2f4d09f87af2ad0f8822.tar.gz |
atspi: fix invalid shift operation.
Add additional check in case when Elm_Atspi_Role_Type enum will enlarge.
CID: 1325724
-rw-r--r-- | src/lib/elm_atspi_bridge.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/elm_atspi_bridge.c b/src/lib/elm_atspi_bridge.c index c75560103..6019cca77 100644 --- a/src/lib/elm_atspi_bridge.c +++ b/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: |