summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2017-11-04 23:06:29 +0100
committerAdam Jackson <ajax@redhat.com>2017-11-06 16:54:22 -0500
commitbb766ef11227bd8c71ac65845d1930edd0eda40d (patch)
tree58119cc64fd66faa3212b374a50392bca83a8b04
parent6828645916505a5925db5c2c2e816fee4e1050e5 (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>
-rw-r--r--randr/rroutput.c2
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;
}