mirror of
https://github.com/X11Libre/xserver.git
synced 2026-11-14 05:14:45 +00:00
xfree86: vidmode: zero gamma ramp reply padding
ProcVidModeGetGammaRamp reserves length = (size + 1) & ~1 entries per channel
but GetGammaRamp() only fills stuff->size entries. When size is odd, the last
CARD16 of each of the three channels was left uninitialized and sent to the
client. The buffer used the non-zeroing x_rpcbuf_reserve().
Use x_rpcbuf_reserve0() for the ramp buffer.
Fixes: 0bf7d613d5 ("xf86vidmode: ProcVidModeSetGammaRamp(): use x_rpcbuf_t")
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
2a25a89422
commit
d5fe1ff412
1 changed files with 1 additions and 1 deletions
|
|
@ -1679,7 +1679,7 @@ ProcVidModeGetGammaRamp(ClientPtr client)
|
|||
|
||||
if (stuff->size) {
|
||||
size_t ramplen = length * 3 * sizeof(CARD16);
|
||||
CARD16 *ramp = x_rpcbuf_reserve(&rpcbuf, ramplen);
|
||||
CARD16 *ramp = x_rpcbuf_reserve0(&rpcbuf, ramplen);
|
||||
if (!ramp)
|
||||
return BadAlloc;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue