diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-07-23 22:11:34 -0700 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-10-19 21:40:28 +0200 |
commit | 6d64c4164c0c2269b1b5a998f1869a6419c3471d (patch) | |
tree | 89180b2510c8f0f7781422f4633c700b058dc1a0 | |
parent | ea8239650656846d810a93e7659e182e412f07b3 (diff) | |
download | nx-libs-6d64c4164c0c2269b1b5a998f1869a6419c3471d.tar.gz nx-libs-6d64c4164c0c2269b1b5a998f1869a6419c3471d.tar.bz2 nx-libs-6d64c4164c0c2269b1b5a998f1869a6419c3471d.zip |
XSetModifierMapping: Use Data instead of GetReqExtra
Handle arbitrary length data in the same fashion as other calls,
avoiding need to ensure it fits all in the request buffer.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
-rw-r--r-- | nx-X11/lib/X11/ModMap.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/nx-X11/lib/X11/ModMap.c b/nx-X11/lib/X11/ModMap.c index 3c6971c77..2fabc560c 100644 --- a/nx-X11/lib/X11/ModMap.c +++ b/nx-X11/lib/X11/ModMap.c @@ -79,17 +79,11 @@ XSetModifierMapping( int mapSize = modifier_map->max_keypermod << 3; /* 8 modifiers */ LockDisplay(dpy); - GetReqExtra(SetModifierMapping, mapSize, req); - if (!req) { - UnlockDisplay(dpy); - return MappingFailed; - } - + GetReq(SetModifierMapping, req); + req->length += mapSize >> 2; req->numKeyPerModifier = modifier_map->max_keypermod; - memcpy((char *) NEXTPTR(req,xSetModifierMappingReq), - (char *) modifier_map->modifiermap, - mapSize); + Data(dpy, modifier_map->modifiermap, mapSize); (void) _XReply(dpy, (xReply *) & rep, (SIZEOF(xSetModifierMappingReply) - SIZEOF(xReply)) >> 2, xTrue); |