diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2017-11-04 23:06:29 +0100 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2017-12-13 10:06:49 -0500 |
commit | c010bcb8c36b2ca0bba1b80c9bde63ff89e42ed4 (patch) | |
tree | 0cd4de3a6a93f75b9ee0aa498ce774fd2363707c /randr | |
parent | c328570644e3b4dfaf840d057883a4db31976da7 (diff) |
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>
(cherry picked from commit bb766ef11227bd8c71ac65845d1930edd0eda40d)
Diffstat (limited to 'randr')
-rw-r--r-- | randr/rroutput.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/randr/rroutput.c b/randr/rroutput.c index a8efec409..647f19a52 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -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; } |