From 266ea63bc3e052b753c5484fa08dcc4fb67c8952 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Fri, 1 Apr 2011 22:55:57 +0200 Subject: [PATCH] Xi: fix querydevice request swapping WriteReplyToClient() swaps rep.length, so it can't be used on return of WriteReplyToClient(). So save it's value for later use. Signed-off-by: Matthieu Herrb Reviewed-by: Julien Cristau --- Xi/xiquerydevice.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index 8b5421130..6eea72410 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -153,8 +153,9 @@ ProcXIQueryDevice(ClientPtr client) } } + len = rep.length * 4; WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep); - WriteToClient(client, rep.length * 4, ptr); + WriteToClient(client, len, ptr); free(ptr); free(skip); return rc;