diff options
author | Keith Packard <keithp@keithp.com> | 2015-01-03 08:46:45 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2015-01-03 21:57:28 -0800 |
commit | dc777c346d5d452a53b13b917c45f6a1bad2f20b (patch) | |
tree | dace5f833241b5a7a34da16c03e753149037e666 | |
parent | 924996c41c419dda0f02a96aafdf52f7670ff4ea (diff) |
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>
-rw-r--r-- | dix/dispatch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c index 55b978dea..9044ac786 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -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) + |