diff options
author | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:47:30 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:47:30 +0200 |
commit | 30463b084b2833193aa6fdc2ceafefc8a1c06fee (patch) | |
tree | fd062f7ac7b98d742a781d5f95e59cbb38fb81bc /nx-X11/programs/Xserver/record | |
parent | 713da22603c4abc7a97feddd931f29c507b7984b (diff) | |
download | nx-libs-30463b084b2833193aa6fdc2ceafefc8a1c06fee.tar.gz nx-libs-30463b084b2833193aa6fdc2ceafefc8a1c06fee.tar.bz2 nx-libs-30463b084b2833193aa6fdc2ceafefc8a1c06fee.zip |
Imported nx-X11-3.2.0-2.tar.gznx-X11/3.2.0-2
Summary: Imported nx-X11-3.2.0-2.tar.gz
Keywords:
Imported nx-X11-3.2.0-2.tar.gz
into Git repository
Diffstat (limited to 'nx-X11/programs/Xserver/record')
-rw-r--r-- | nx-X11/programs/Xserver/record/record.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c index beea616c0..fd5e5db1d 100644 --- a/nx-X11/programs/Xserver/record/record.c +++ b/nx-X11/programs/Xserver/record/record.c @@ -2720,7 +2720,7 @@ SProcRecordQueryVersion(client) } /* SProcRecordQueryVersion */ -static void +static int SwapCreateRegister(xRecordRegisterClientsReq *stuff) { register char n; @@ -2731,11 +2731,17 @@ SwapCreateRegister(xRecordRegisterClientsReq *stuff) swapl(&stuff->nClients, n); swapl(&stuff->nRanges, n); pClientID = (XID *)&stuff[1]; + if (stuff->nClients > stuff->length - (sz_xRecordRegisterClientsReq >> 2)) + return BadLength; for (i = 0; i < stuff->nClients; i++, pClientID++) { swapl(pClientID, n); } + if (stuff->nRanges > stuff->length - (sz_xRecordRegisterClientsReq >> 2) + - stuff->nClients) + return BadLength; RecordSwapRanges((xRecordRange *)pClientID, stuff->nRanges); + return Success; } /* SwapCreateRegister */ @@ -2744,11 +2750,13 @@ SProcRecordCreateContext(client) ClientPtr client; { REQUEST(xRecordCreateContextReq); + int status; register char n; swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq); - SwapCreateRegister((pointer)stuff); + if ((status = SwapCreateRegister((pointer)stuff)) != Success) + return status; return ProcRecordCreateContext(client); } /* SProcRecordCreateContext */ @@ -2758,11 +2766,13 @@ SProcRecordRegisterClients(client) ClientPtr client; { REQUEST(xRecordRegisterClientsReq); + int status; register char n; swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq); - SwapCreateRegister((pointer)stuff); + if ((status = SwapCreateRegister((pointer)stuff)) != Success) + return status; return ProcRecordRegisterClients(client); } /* SProcRecordRegisterClients */ |