[Xcb] [Bug 57022] New: xkb crash when iterating xcb_xkb_get_map() data.

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Nov 12 09:01:32 PST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=57022

          Priority: medium
            Bug ID: 57022
          Assignee: xcb at lists.freedesktop.org
           Summary: xkb crash when iterating xcb_xkb_get_map() data.
        QA Contact: xcb at lists.freedesktop.org
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: gatis.paeglis at digia.com
          Hardware: Other
            Status: NEW
           Version: unspecified
         Component: Library
           Product: XCB

Fallowing example always crashes when trying to read data returned from
xcb_xkb_get_map(). Tested with both real and virtual modifiers, unable to read
keycodes.

    xcb_xkb_get_map_cookie_t map_cookie;
    xcb_xkb_get_map_reply_t *map_reply;
    xcb_generic_error_t *map_error = 0;

    map_cookie = xcb_xkb_get_map(xcb_connection(),
                                 XCB_XKB_ID_USE_CORE_KBD,
                                 XCB_XKB_MAP_PART_VIRTUAL_MOD_MAP |
                                 XCB_XKB_MAP_PART_KEY_TYPES |
                                 XCB_XKB_MAP_PART_KEY_SYMS |
                                 XCB_XKB_MAP_PART_EXPLICIT_COMPONENTS |
                                 XCB_XKB_MAP_PART_KEY_ACTIONS |
                                 XCB_XKB_MAP_PART_KEY_BEHAVIORS |
                                 XCB_XKB_MAP_PART_VIRTUAL_MODS |
                                 XCB_XKB_MAP_PART_MODIFIER_MAP,
                                 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); // hmm

    map_reply = xcb_xkb_get_map_reply(xcb_connection(), map_cookie,
&map_error);
    if (map_error) {
        free(map_error);
        return;
    }

    const xcb_xkb_get_map_map_t *map = (xcb_xkb_get_map_map_t
*)xcb_xkb_get_map_map(map_reply);


    xcb_xkb_key_v_mod_map_iterator_t iter =
xcb_xkb_get_map_map_vmodmap_rtrn_iterator(map_reply, map);
    xcb_keycode_t key = 0;
    while (iter.rem) {
        if (iter.data) {
            key = iter.data->keycode; // <----- CRASH
            xcb_xkb_key_v_mod_map_next(&iter);
        }
    }

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20121112/02cd7881/attachment.html>


More information about the Xcb mailing list