diff options
author | Matthieu Herrb <matthieu@bluenote.herrb.com> | 2008-01-17 15:27:34 +0100 |
---|---|---|
committer | Matthieu Herrb <matthieu@bluenote.herrb.com> | 2008-01-17 15:27:34 +0100 |
commit | dd5e0f5cd5f3a87fee86d99c073ffa7cf89b0a27 (patch) | |
tree | a7a83cc3bc0c643201cf9b51e7debc4081cef020 /Xi/chgprop.c | |
parent | bbde5b62a137ba726a747b838d81e92d72c1b42b (diff) |
Fix for CVE-2007-6427 - Xinput extension memory corruption.
Diffstat (limited to 'Xi/chgprop.c')
-rw-r--r-- | Xi/chgprop.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Xi/chgprop.c b/Xi/chgprop.c index 58db88620..3fb33e129 100644 --- a/Xi/chgprop.c +++ b/Xi/chgprop.c @@ -77,19 +77,15 @@ int SProcXChangeDeviceDontPropagateList(ClientPtr client) { char n; - long *p; - int i; REQUEST(xChangeDeviceDontPropagateListReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq); swapl(&stuff->window, n); swaps(&stuff->count, n); - p = (long *)&stuff[1]; - for (i = 0; i < stuff->count; i++) { - swapl(p, n); - p++; - } + REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq, + stuff->count * sizeof(CARD32)); + SwapLongs((CARD32 *) (&stuff[1]), stuff->count); return (ProcXChangeDeviceDontPropagateList(client)); } |