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

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