summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-06-12 14:43:23 -0400
committerAdam Jackson <ajax@redhat.com>2017-09-25 15:34:10 -0400
commit87a7393799ab5d1ea4a19ae7687cd50ac0dceeb4 (patch)
tree9d6be026e51b43ec35d3d18a5d59d93542796b90 /hw
parentfaeee7646695261e60ea03d934a0c496a429f31b (diff)
modesetting: Validate the atom for enum properties
The client could have said anything here, and if what they said doesn't actually name an atom NameForAtom() will return NULL, and strcmp() will be unhappy about that. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit d4995a3936ae283b9080fdaa0905daa669ebacfc)
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/drivers/modesetting/drmmode_display.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 6e755e948..415c1b38d 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1566,7 +1566,8 @@ drmmode_output_set_property(xf86OutputPtr output, Atom property,
value->size != 1)
return FALSE;
memcpy(&atom, value->data, 4);
- name = NameForAtom(atom);
+ if (!(name = NameForAtom(atom)))
+ return FALSE;
/* search for matching name string, then set its value down */
for (j = 0; j < p->mode_prop->count_enums; j++) {