Blame SOURCES/0001-xrandr-init-the-name-to-0.patch

185bf5
From a2134406ab0aef44e7b710e1e2a2a40965e96692 Mon Sep 17 00:00:00 2001
185bf5
From: Peter Hutterer <peter.hutterer@who-t.net>
185bf5
Date: Thu, 13 Sep 2018 09:44:16 +1000
185bf5
Subject: [PATCH app/xrandr] init the name to 0
185bf5
185bf5
There are a few conditions where coverity finds a use of an uninitialized
185bf5
field of the name_t struct. These are rather messy combinations of conditions,
185bf5
so let's go with the simple solution here and just init everything to 0.
185bf5
This may still have side-effects but at least they'll be more obvious than the
185bf5
previous "use whatever memory is leftover from breakfast".
185bf5
185bf5
This patch also adds a missing init_name(), much for the same reason.
185bf5
185bf5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
185bf5
---
185bf5
 xrandr.c | 2 ++
185bf5
 1 file changed, 2 insertions(+)
185bf5
185bf5
diff --git a/xrandr.c b/xrandr.c
185bf5
index 7f1e867..ce3cd91 100644
185bf5
--- a/xrandr.c
185bf5
+++ b/xrandr.c
185bf5
@@ -637,6 +637,7 @@ print_verbose_mode (const XRRModeInfo *mode, Bool current, Bool preferred)
185bf5
 static void
185bf5
 init_name (name_t *name)
185bf5
 {
185bf5
+    memset(name, 0, sizeof(*name));
185bf5
     name->kind = name_none;
185bf5
 }
185bf5
 
185bf5
@@ -1822,6 +1823,7 @@ get_outputs (void)
185bf5
 	output_t	*output;
185bf5
 	name_t		output_name;
185bf5
 	if (!output_info) fatal ("could not get output 0x%lx information\n", res->outputs[o]);
185bf5
+	init_name(&output_name);
185bf5
 	set_name_xid (&output_name, res->outputs[o]);
185bf5
 	set_name_index (&output_name, o);
185bf5
 	set_name_string (&output_name, output_info->name);
185bf5
-- 
185bf5
2.17.1
185bf5