[PATCH 5/5] glx: Handle failure to create the pixmap backing the pbuffer

Tomasz Lis listom at gmail.com
Mon Mar 4 06:39:33 PST 2013


I agree with that change.

Not only width and height, but also BPP can be unsupported by DRM, and
having no error support here caused XServer to crash on me a few times.


2013/2/25 Adam Jackson <ajax at redhat.com>

> We happen not to sanitize the width/height we pass to CreatePixmap here,
> oops.  It's not exploitable, but it's certainly a crash, so let's just
> throw BadAlloc instead.
>
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  glx/glxcmds.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/glx/glxcmds.c b/glx/glxcmds.c
> index 41313f2..ddbf44d 100644
> --- a/glx/glxcmds.c
> +++ b/glx/glxcmds.c
> @@ -1428,6 +1428,8 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID
> fbconfigId,
>                                                      width, height,
>                                                      config->rgbBits, 0);
>      __glXleaveServer(GL_FALSE);
> +    if (!pPixmap)
> +        return BadAlloc;
>
>      /* Assign the pixmap the same id as the pbuffer and add it as a
>       * resource so it and the DRI2 drawable will be reclaimed when the
> --
> 1.8.1.4
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20130304/9160c40b/attachment-0001.html>


More information about the xorg-devel mailing list