diff options
author | Adam Jackson <ajax@redhat.com> | 2017-06-13 09:36:21 -0400 |
---|---|---|
committer | Michel Dänzer <michel.daenzer@amd.com> | 2017-06-15 12:19:07 +0900 |
commit | 184d50e008b9b31f4dda1425e255af068b6ab068 (patch) | |
tree | 9e06c28982c645d58a5b20eca6de4e139e2e9b9f /src/drmmode_display.c | |
parent | bbdac40e2af472d37aa0f4f26df77a0b1b12a830 (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>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'src/drmmode_display.c')
-rw-r--r-- | src/drmmode_display.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index f4bea0c..0d90041 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -1663,7 +1663,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++) { |