summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x
diff options
context:
space:
mode:
authorBenjamin Jacobs <benj@spam.thsi.be>2016-07-11 14:19:59 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-11 14:20:00 +0900
commite03d4142ef22bc15c24a3969e32933e17bab1c23 (patch)
tree4db5b73d971360360b3c558fe4f4ec15538134e9 /src/lib/ecore_x
parent899d2d957a790aa3fb0bd6dbcfbed64ea76ba14f (diff)
ecore_x: NULL derefs.
Reviewers: raster, devilhorns Subscribers: raster, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4018
Diffstat (limited to 'src/lib/ecore_x')
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb.c9
-rw-r--r--src/lib/ecore_x/xlib/ecore_x.c3
2 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/ecore_x/xcb/ecore_xcb.c b/src/lib/ecore_x/xcb/ecore_xcb.c
index 15107fb10d..9e08aef726 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb.c
@@ -504,9 +504,12 @@ ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_Atom type,
504 ev.format = 8; 504 ev.format = 8;
505 ev.window = win; 505 ev.window = win;
506 ev.type = type; 506 ev.type = type;
507 if (len > 20) len = 20; 507 if (len > 20)
508 memcpy(ev.data.data8, data, len); 508 len = 20;
509 memset(ev.data.data8 + len, 0, 20 - len); 509 if (data && len > 0)
510 memcpy(ev.data.data8, data, len);
511 if (len < 20)
512 memset(ev.data.data8 + len, 0, 20 - len);
510 513
511 cookie = xcb_send_event(_ecore_xcb_conn, 0, win, 514 cookie = xcb_send_event(_ecore_xcb_conn, 0, win,
512 XCB_EVENT_MASK_NO_EVENT, (const char *)&ev); 515 XCB_EVENT_MASK_NO_EVENT, (const char *)&ev);
diff --git a/src/lib/ecore_x/xlib/ecore_x.c b/src/lib/ecore_x/xlib/ecore_x.c
index 546257b2da..ae8b5bd2cf 100644
--- a/src/lib/ecore_x/xlib/ecore_x.c
+++ b/src/lib/ecore_x/xlib/ecore_x.c
@@ -2124,7 +2124,8 @@ ecore_x_client_message8_send(Ecore_X_Window win,
2124 if (len > 20) 2124 if (len > 20)
2125 len = 20; 2125 len = 20;
2126 2126
2127 memcpy(xev.xclient.data.b, data, len); 2127 if (data && len > 0)
2128 memcpy(xev.xclient.data.b, data, len);
2128 if (len < 20) 2129 if (len < 20)
2129 memset(xev.xclient.data.b + len, 0, 20 - len); 2130 memset(xev.xclient.data.b + len, 0, 20 - len);
2130 2131