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

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