Blame SOURCES/0002-modesetting-Validate-the-atom-for-enum-properties.patch

45aa48
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
45aa48
From: Adam Jackson <ajax@redhat.com>
45aa48
Date: Tue, 13 Jun 2017 09:29:28 -0400
45aa48
Subject: [PATCH] modesetting: Validate the atom for enum properties
45aa48
45aa48
The client could have said anything here, and if what they said doesn't
45aa48
actually name an atom NameForAtom() will return NULL, and strcmp() will
45aa48
be unhappy about that.
45aa48
45aa48
[copied from xserver d4995a3936ae283b9080fdaa0905daa669ebacfc]
45aa48
45aa48
Signed-off-by: Adam Jackson <ajax@redhat.com>
45aa48
---
45aa48
 src/qxl_drmmode.c | 3 ++-
45aa48
 1 file changed, 2 insertions(+), 1 deletion(-)
45aa48
45aa48
diff --git a/src/qxl_drmmode.c b/src/qxl_drmmode.c
45aa48
index 3c288f9..ff164cd 100644
45aa48
--- a/src/qxl_drmmode.c
45aa48
+++ b/src/qxl_drmmode.c
45aa48
@@ -622,7 +622,8 @@ drmmode_output_set_property(xf86OutputPtr output, Atom property,
45aa48
 	    if (value->type != XA_ATOM || value->format != 32 || value->size != 1)
45aa48
 		return FALSE;
45aa48
 	    memcpy(&atom, value->data, 4);
45aa48
-	    name = NameForAtom(atom);
45aa48
+	    if (!(name = NameForAtom(atom)))
45aa48
+                return FALSE;
45aa48
 
45aa48
 	    /* search for matching name string, then set its value down */
45aa48
 	    for (j = 0; j < p->mode_prop->count_enums; j++) {