File U_Advance-the-request-buffer-by-the-right-amount-in-XIChangeHierarchy.patch of Package libXi.5236

From: Julien Cristau <jcristau@debian.org>
Date: Mon Oct 27 19:00:36 2014 +0100
Subject: [PATCH]Advance the request buffer by the right amount in XIChangeHierarchy
Patch-mainline: Upstream
Git-commit: 71a42145b678be623e30bd5bf55833a04f14376f
Git-repo: git://anongit.freedesktop.org/git/xorg/lib/libXi
References: 
Signed-off-by: Egbert Eich <eich@suse.com>

c->length is in 4-byte units, dptr is a char *, so we need to advance
dptr by 4 * length to get the position of the next HierarchyChangeInfo.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
---
 src/XIHierarchy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/XIHierarchy.c b/src/XIHierarchy.c
index 39c3d1b..3d2b4f2 100644
--- a/src/XIHierarchy.c
+++ b/src/XIHierarchy.c
@@ -109,7 +109,7 @@ XIChangeHierarchy(Display* dpy,
                     c->name_len = strlen(C->name);
                     c->length = (sizeof(xXIAddMasterInfo) + c->name_len + 3)/4;
                     strncpy((char*)&c[1], C->name, c->name_len);
-                    dptr += c->length;
+                    dptr += 4 * c->length;
                 }
                 break;
             case XIRemoveMaster:
openSUSE Build Service is sponsored by