|
|
4724a4 |
From d4995a3936ae283b9080fdaa0905daa669ebacfc Mon Sep 17 00:00:00 2001
|
|
|
4724a4 |
From: Adam Jackson <ajax@redhat.com>
|
|
|
4724a4 |
Date: Mon, 12 Jun 2017 14:43:23 -0400
|
|
|
4724a4 |
Subject: [PATCH xserver] modesetting: Validate the atom for enum properties
|
|
|
4724a4 |
|
|
|
4724a4 |
The client could have said anything here, and if what they said doesn't
|
|
|
4724a4 |
actually name an atom NameForAtom() will return NULL, and strcmp() will
|
|
|
4724a4 |
be unhappy about that.
|
|
|
4724a4 |
|
|
|
4724a4 |
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
|
4724a4 |
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
4724a4 |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
4724a4 |
---
|
|
|
4724a4 |
hw/xfree86/drivers/modesetting/drmmode_display.c | 3 ++-
|
|
|
4724a4 |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
4724a4 |
|
|
|
4724a4 |
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
|
|
|
4724a4 |
index aa6baae09..961b56127 100644
|
|
|
4724a4 |
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
|
|
|
4724a4 |
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
|
|
|
4724a4 |
@@ -1557,7 +1557,8 @@ drmmode_output_set_property(xf86OutputPtr output, Atom property,
|
|
|
4724a4 |
value->size != 1)
|
|
|
4724a4 |
return FALSE;
|
|
|
4724a4 |
memcpy(&atom, value->data, 4);
|
|
|
4724a4 |
- name = NameForAtom(atom);
|
|
|
4724a4 |
+ if (!(name = NameForAtom(atom)))
|
|
|
4724a4 |
+ return FALSE;
|
|
|
4724a4 |
|
|
|
4724a4 |
/* search for matching name string, then set its value down */
|
|
|
4724a4 |
for (j = 0; j < p->mode_prop->count_enums; j++) {
|
|
|
4724a4 |
--
|
|
|
4724a4 |
2.13.0
|
|
|
4724a4 |
|