summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-06-13 09:23:42 -0400
committerAdam Jackson <ajax@redhat.com>2017-06-13 09:23:57 -0400
commit69aecdd305defdd014bc92b82acc6000988511cf (patch)
treedcb79560b46559f9de63e27271aedd54d3869f4c /src
parenta7c190e0c230ed2d5e047ed6aba12d71a4866950 (diff)
downloadxorg-driver-xf86-video-nouveau-69aecdd305defdd014bc92b82acc6000988511cf.tar.gz
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. [copied from xserver d4995a3936ae283b9080fdaa0905daa669ebacfc] Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/drmmode_display.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 2b71c9c..04a0b57 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1081,7 +1081,8 @@ drmmode_output_set_property(xf86OutputPtr output, Atom property,
if (value->type != XA_ATOM || value->format != 32 || 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++) {