summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-06-12 10:54:55 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-06-12 12:37:16 +1000
commit98e8ec8deb09db1c56e06afed267e6f517042fa3 (patch)
tree17d198e7e512343428b63b98b14a552ffd40e35c
parent96ea82fdac7c28feb2748cd4ff7faa7c00dbbdcd (diff)
Xi: sanitize ProcXIGetClientPointer.
This was quite old code and can be streamlined a bit. The new code is essentially the same as in ProcXISetClientPointer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--Xi/getcptr.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/Xi/getcptr.c b/Xi/getcptr.c
index 9cce5c35b..92fae8244 100644
--- a/Xi/getcptr.c
+++ b/Xi/getcptr.c
@@ -59,22 +59,21 @@ SProcXIGetClientPointer(ClientPtr client)
int ProcXIGetClientPointer(ClientPtr client)
{
- int err;
- WindowPtr win;
+ int rc;
ClientPtr winclient;
xXIGetClientPointerReply rep;
REQUEST(xXIGetClientPointerReq);
REQUEST_SIZE_MATCH(xXIGetClientPointerReq);
- err = dixLookupWindow(&win, stuff->win, client, DixReadAccess);
- if (err != Success)
+ if (stuff->win != None)
{
- SendErrorToClient(client, IReqCode, X_XIGetClientPointer,
- stuff->win, err);
- return Success;
- }
+ rc = dixLookupClient(&winclient, stuff->win, client,
+ DixWriteAccess);
- winclient = wClient(win);
+ if (rc != Success)
+ return BadWindow;
+ } else
+ winclient = client;
rep.repType = X_Reply;
rep.RepType = X_XIGetClientPointer;