summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-06-13 09:28:05 -0400
committerAdam Jackson <ajax@redhat.com>2017-06-13 09:28:05 -0400
commit9cb2ef4ed1115f307ea7f260a327fc42e5826a38 (patch)
treecda2cb9097294f1343c57cd46e167a06c399fd2b
parente84202a57bba1c97955cbf99ee78354433fd8bfe (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. [copied from xserver d4995a3936ae283b9080fdaa0905daa669ebacfc] Signed-off-by: Adam Jackson <ajax@redhat.com>
-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 d6062ac..e9c0eac 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -942,7 +942,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++) {