[PATCH 4/4] Xi: fix querydevice request swapping

Matthieu Herrb matthieu.herrb at laas.fr
Fri Apr 1 14:05:43 PDT 2011


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 <matthieu.herrb at laas.fr>
---
 Xi/xiquerydevice.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
index 8b54211..670216c 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;
-- 
1.7.3.5



More information about the xorg-devel mailing list