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