[PATCH xserver 1/3] randr: rrGetScreenResources: initialize memory

Giuseppe Bilotta giuseppe.bilotta at gmail.com
Thu Nov 9 09:21:19 UTC 2017


Similarly to bb766ef11227bd8c71ac65845d1930edd0eda40d, ensure that the
extra padding is set to 0.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
---
 randr/rrscreen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index d6c499580..0c70b28dd 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -558,7 +558,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
 
         extraLen = rep.length << 2;
         if (extraLen) {
-            extra = malloc(extraLen);
+            extra = calloc(1, extraLen);
             if (!extra) {
                 free(modes);
                 return BadAlloc;
-- 
2.14.1.439.g647b9b4702



More information about the xorg-devel mailing list