ecore-imf-wayland: Check xkb_keysym_to_utf8
authorBryce Harrington <bryce@osg.samsung.com>
Fri, 2 Jun 2017 23:06:31 +0000 (19:06 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 2 Jun 2017 23:06:31 +0000 (19:06 -0400)
Summary:
Coverity reports an error "Calling "xkb_keysym_to_utf8" without checking
return value (as is done elsewhere 4 out of 5 times)."

fixes: cid1375673

Reviewers: zmike

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4936

src/modules/ecore_imf/wayland/wayland_imcontext.c

index 76bd728..ad9b614 100644 (file)
@@ -614,7 +614,7 @@ text_input_keysym(void *data,
      snprintf(keyname, sizeof(keyname), "Keysym-%u", sym);
 
    memset(string, 0, sizeof(string));
-   xkb_keysym_to_utf8(sym, string, 32);
+   if (!xkb_keysym_to_utf8(sym, string, 32)) return;
 
    EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom,
                      "key event (key: %s)",