randr: ProcRRGetOutputInfo: initialize memory

Running Xephyr under valgrind reveals that we're sending some
uninitialized memory over the wire (particularly, the leftover padding
that comes from rounding extraLen to the next 32-bit multiple).

Solve by calloc()ing the memory instead of malloc()ing (the alternative
would be to memset just the padding, but I'm not sure it's more
convenient.)

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Giuseppe Bilotta 2017-11-04 23:06:29 +01:00 committed by Adam Jackson
parent 6828645916
commit bb766ef112

View File

@ -459,7 +459,7 @@ ProcRRGetOutputInfo(ClientPtr client)
if (extraLen) {
rep.length += bytes_to_int32(extraLen);
extra = malloc(extraLen);
extra = calloc(1, extraLen);
if (!extra)
return BadAlloc;
}