bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=aca00f85021204bf18a536e271f7525781ff956b

commit aca00f85021204bf18a536e271f7525781ff956b
Author: Marcel Hollerbach <[email protected]>
Date:   Tue Aug 1 18:12:21 2017 +0200

    ecore_x: init XEvents before passing to x
    
    it turns out that xlib is going to copy the complete struct into
    something internal. This might lead to the condition that a uninitalized
    value might be part of the struct, and when later the struct is read
    again the code might do wrong stuff since that value could be set now to
    a randomly other meaningfull value.
    
    This turned out on me in e as i could not write any letters like ßöäü,
    since that lead to a not returning call to _XReply internal of xlib.
    Dugging that showed that xlib was waiting on a reply of a call that
    never got executed, and the XEvent it is waiting on just contians a
    randomly correct value.
    
    @fix
---
 src/lib/ecore_x/ecore_x.c           | 16 ++++++++--------
 src/lib/ecore_x/ecore_x_dnd.c       |  8 ++++----
 src/lib/ecore_x/ecore_x_e.c         | 24 ++++++++++++------------
 src/lib/ecore_x/ecore_x_icccm.c     |  2 +-
 src/lib/ecore_x/ecore_x_netwm.c     | 12 ++++++------
 src/lib/ecore_x/ecore_x_selection.c |  2 +-
 src/lib/ecore_x/ecore_x_window.c    |  4 ++--
 7 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/src/lib/ecore_x/ecore_x.c b/src/lib/ecore_x/ecore_x.c
index 8ca8e61f45..f54f3c30be 100644
--- a/src/lib/ecore_x/ecore_x.c
+++ b/src/lib/ecore_x/ecore_x.c
@@ -1770,7 +1770,7 @@ ecore_x_window_button_grab(Ecore_X_Window win,
 static void
 _ecore_x_sync_magic_send(int val, Ecore_X_Window swin, int b, int mod, int 
anymod)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    xev.xclient.type = ClientMessage;
    xev.xclient.serial = 0;
@@ -2138,7 +2138,7 @@ ecore_x_client_message32_send(Ecore_X_Window win,
                               long d3,
                               long d4)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    Eina_Bool ret;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -2174,7 +2174,7 @@ ecore_x_client_message8_send(Ecore_X_Window win,
                              const void *data,
                              int len)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    Eina_Bool ret;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -2201,7 +2201,7 @@ ecore_x_mouse_move_send(Ecore_X_Window win,
                         int x,
                         int y)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    XWindowAttributes att;
    Window tw;
    int rx, ry;
@@ -2234,7 +2234,7 @@ ecore_x_mouse_down_send(Ecore_X_Window win,
                         int y,
                         int b)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    XWindowAttributes att;
    Window tw;
    int rx, ry;
@@ -2267,7 +2267,7 @@ ecore_x_mouse_up_send(Ecore_X_Window win,
                       int y,
                       int b)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    XWindowAttributes att;
    Window tw;
    int rx, ry;
@@ -2299,7 +2299,7 @@ ecore_x_mouse_in_send(Ecore_X_Window win,
                       int x,
                       int y)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    XWindowAttributes att;
    Window tw;
    int rx, ry;
@@ -2333,7 +2333,7 @@ ecore_x_mouse_out_send(Ecore_X_Window win,
                       int x,
                       int y)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    XWindowAttributes att;
    Window tw;
    int rx, ry;
diff --git a/src/lib/ecore_x/ecore_x_dnd.c b/src/lib/ecore_x/ecore_x_dnd.c
index 4398754fa9..59607b8f7c 100644
--- a/src/lib/ecore_x/ecore_x_dnd.c
+++ b/src/lib/ecore_x/ecore_x_dnd.c
@@ -469,7 +469,7 @@ _ecore_x_dnd_begin(Ecore_X_Window source,
 static Eina_Bool
 _ecore_x_dnd_drop(Eina_Bool self)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    int status = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -549,7 +549,7 @@ ecore_x_dnd_send_status(Eina_Bool will_accept,
                         Ecore_X_Rectangle rectangle,
                         Ecore_X_Atom action)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
 
@@ -601,7 +601,7 @@ ecore_x_dnd_send_status(Eina_Bool will_accept,
 EAPI void
 ecore_x_dnd_send_finished(void)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
 
@@ -649,7 +649,7 @@ _ecore_x_dnd_drag(Ecore_X_Window root,
                   int x,
                   int y)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    Ecore_X_Window win;
    Ecore_X_Window *skip;
    Ecore_X_Xdnd_Position pos;
diff --git a/src/lib/ecore_x/ecore_x_e.c b/src/lib/ecore_x/ecore_x_e.c
index c6ca7545a8..9999af1065 100644
--- a/src/lib/ecore_x/ecore_x_e.c
+++ b/src/lib/ecore_x/ecore_x_e.c
@@ -1100,7 +1100,7 @@ EAPI void
 ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root,
                                    Ecore_X_Window win)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
@@ -1132,7 +1132,7 @@ ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window 
root,
                                         int w,
                                         int h)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
@@ -1457,7 +1457,7 @@ ecore_x_e_window_profile_change_send(Ecore_X_Window  root,
                                      Ecore_X_Window  win,
                                      const char     *profile)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    Ecore_X_Atom atom;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1493,7 +1493,7 @@ EAPI void
 ecore_x_e_window_profile_change_request_send(Ecore_X_Window win,
                                              const char    *profile)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    Ecore_X_Atom atom;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1526,7 +1526,7 @@ ecore_x_e_window_profile_change_done_send(Ecore_X_Window 
root,
                                           Ecore_X_Window win,
                                           const char    *profile)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    Ecore_X_Atom atom;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1629,7 +1629,7 @@ ecore_x_e_comp_sync_supported_get(Ecore_X_Window root)
 EAPI void
 ecore_x_e_comp_sync_begin_send(Ecore_X_Window win)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
@@ -1655,7 +1655,7 @@ ecore_x_e_comp_sync_begin_send(Ecore_X_Window win)
 EAPI void
 ecore_x_e_comp_sync_end_send(Ecore_X_Window win)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
@@ -1681,7 +1681,7 @@ ecore_x_e_comp_sync_end_send(Ecore_X_Window win)
 EAPI void
 ecore_x_e_comp_sync_cancel_send(Ecore_X_Window win)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
@@ -1707,7 +1707,7 @@ ecore_x_e_comp_sync_cancel_send(Ecore_X_Window win)
 EAPI void
 ecore_x_e_comp_flush_send(Ecore_X_Window win)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
@@ -1733,7 +1733,7 @@ ecore_x_e_comp_flush_send(Ecore_X_Window win)
 EAPI void
 ecore_x_e_comp_dump_send(Ecore_X_Window win)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
@@ -2288,7 +2288,7 @@ 
ecore_x_e_window_rotation_change_prepare_done_send(Ecore_X_Window root,
                                                    Ecore_X_Window win,
                                                    int            rot)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
@@ -2331,7 +2331,7 @@ ecore_x_e_window_rotation_change_done_send(Ecore_X_Window 
root,
                                            int            w,
                                            int            h)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
diff --git a/src/lib/ecore_x/ecore_x_icccm.c b/src/lib/ecore_x/ecore_x_icccm.c
index d335fd2dea..4bf81da5ac 100644
--- a/src/lib/ecore_x/ecore_x_icccm.c
+++ b/src/lib/ecore_x/ecore_x_icccm.c
@@ -1235,7 +1235,7 @@ EAPI void
 ecore_x_icccm_iconic_request_send(Ecore_X_Window win,
                                   Ecore_X_Window root)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    if (!win)
      return;
diff --git a/src/lib/ecore_x/ecore_x_netwm.c b/src/lib/ecore_x/ecore_x_netwm.c
index 83615e7419..182021aad1 100644
--- a/src/lib/ecore_x/ecore_x_netwm.c
+++ b/src/lib/ecore_x/ecore_x_netwm.c
@@ -351,7 +351,7 @@ ecore_x_netwm_client_active_request(Ecore_X_Window root,
                                     int type,
                                     Ecore_X_Window current_win)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
    if (!root)
@@ -1500,7 +1500,7 @@ ecore_x_netwm_sync_counter_get(Ecore_X_Window win,
 EAPI void
 ecore_x_netwm_ping_send(Ecore_X_Window win)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    if (!win)
      return;
@@ -1526,7 +1526,7 @@ ecore_x_netwm_sync_request_send(Ecore_X_Window win,
                                 unsigned int serial)
 {
    XSyncValue value;
-   XEvent xev;
+   XEvent xev = { 0 };
 
    if (!win)
      return;
@@ -1556,7 +1556,7 @@ ecore_x_netwm_state_request_send(Ecore_X_Window win,
                                  Ecore_X_Window_State s2,
                                  Eina_Bool set)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    if (!win)
      return;
@@ -1590,7 +1590,7 @@ ecore_x_netwm_desktop_request_send(Ecore_X_Window win,
                                    Ecore_X_Window root,
                                    unsigned int desktop)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    if (!win)
      return;
@@ -1620,7 +1620,7 @@ ecore_x_netwm_moveresize_request_send(Ecore_X_Window win,
                                       Ecore_X_Netwm_Direction direction,
                                       unsigned int button)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    if (!win)
      return;
diff --git a/src/lib/ecore_x/ecore_x_selection.c 
b/src/lib/ecore_x/ecore_x_selection.c
index ff0480d041..22cd5c8c7f 100644
--- a/src/lib/ecore_x/ecore_x_selection.c
+++ b/src/lib/ecore_x/ecore_x_selection.c
@@ -491,7 +491,7 @@ ecore_x_selection_notify_send(Ecore_X_Window requestor,
                               Ecore_X_Atom property,
                               Ecore_X_Time tim)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    XSelectionEvent xnotify;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
diff --git a/src/lib/ecore_x/ecore_x_window.c b/src/lib/ecore_x/ecore_x_window.c
index 444538a1c4..5600956605 100644
--- a/src/lib/ecore_x/ecore_x_window.c
+++ b/src/lib/ecore_x/ecore_x_window.c
@@ -467,7 +467,7 @@ ecore_x_window_ignore_list(int *num)
 EAPI void
 ecore_x_window_delete_request_send(Ecore_X_Window win)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
 
    /* sorry sir, deleting the root window doesn't sound like
     * a smart idea.
@@ -522,7 +522,7 @@ ecore_x_window_show(Ecore_X_Window win)
 EAPI void
 ecore_x_window_hide(Ecore_X_Window win)
 {
-   XEvent xev;
+   XEvent xev = { 0 };
    Window root;
    int idum;
    unsigned int uidum;

-- 


Reply via email to