mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-05 01:48:02 +02:00
dix: Allow zero-height PutImage requests
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. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
parent
924996c41c
commit
dc777c346d
1 changed files with 1 additions and 1 deletions
|
|
@ -2000,7 +2000,7 @@ ProcPutImage(ClientPtr client)
|
|||
tmpImage = (char *) &stuff[1];
|
||||
lengthProto = length;
|
||||
|
||||
if (lengthProto >= (INT32_MAX / stuff->height))
|
||||
if (stuff->height != 0 && lengthProto >= (INT32_MAX / stuff->height))
|
||||
return BadLength;
|
||||
|
||||
if ((bytes_to_int32(lengthProto * stuff->height) +
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue