[PATCH xserver] modesetting: Validate the atom for enum properties
Peter Hutterer
peter.hutterer at who-t.net
Mon Jun 12 22:59:46 UTC 2017
On Mon, Jun 12, 2017 at 02:43:23PM -0400, Adam Jackson wrote:
> 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 at redhat.com>
remote: I: patch #161315 updated using rev d4995a3936ae283b9080fdaa0905daa669ebacfc.
remote: I: 1 patch(es) updated to state Accepted.
To git+ssh://git.freedesktop.org/git/xorg/xserver
7c7a540f1..d4995a393 master -> master
Cheers,
Peter
> ---
> hw/xfree86/drivers/modesetting/drmmode_display.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
> index aa6baae09..961b56127 100644
> --- a/hw/xfree86/drivers/modesetting/drmmode_display.c
> +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
> @@ -1557,7 +1557,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++) {
> --
> 2.13.0
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
>
More information about the xorg-devel
mailing list