Commit dba779d9 authored by Keith Packard's avatar Keith Packard Committed by Mike Gabriel

dix: Allow zero-height PutImage requests (fix for X.Org's CVE-2015-3418).

The length checking code validates PutImage height and byte width by making sure that byte-width >= INT32_MAX / height. If height is zero, this generates a divide by zero exception. Allow zero height requests explicitly, bypassing the INT32_MAX check. Fix for regression introduced by fix for CVE-2014-8092. v2: backports to nx-libs 3.6.x (Mike Gabriel) Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
parent 7ccbb073
...@@ -2071,7 +2071,7 @@ ProcPutImage(register ClientPtr client) ...@@ -2071,7 +2071,7 @@ ProcPutImage(register ClientPtr client)
tmpImage = (char *)&stuff[1]; tmpImage = (char *)&stuff[1];
lengthProto = length; lengthProto = length;
if (lengthProto >= (INT32_MAX / stuff->height)) if (stuff->height != 0 && lengthProto >= (INT32_MAX / stuff->height))
return BadLength; return BadLength;
if (((((lengthProto * stuff->height) + (unsigned)3) >> 2) + if (((((lengthProto * stuff->height) + (unsigned)3) >> 2) +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment