mirror of
https://github.com/openbsd/xenocara.git
synced 2025-12-08 10:19:00 +00:00
MFC: xfixes: unvalidated lengths (CVE-2017-12183)
v2: Use before swap (Jeremy Huddleston Sequoia) v3: Fix wrong XFixesCopyRegion checks (Alan Coopersmith)
This commit is contained in:
@@ -359,6 +359,7 @@ ProcXFixesCopyRegion(ClientPtr client)
|
||||
RegionPtr pSource, pDestination;
|
||||
|
||||
REQUEST(xXFixesCopyRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesCopyRegionReq);
|
||||
|
||||
VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
|
||||
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
|
||||
@@ -375,7 +376,7 @@ SProcXFixesCopyRegion(ClientPtr client)
|
||||
REQUEST(xXFixesCopyRegionReq);
|
||||
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXFixesCopyRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesCopyRegionReq);
|
||||
swapl(&stuff->source);
|
||||
swapl(&stuff->destination);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
|
||||
Reference in New Issue
Block a user