On 29 July 2015 at 18:17, Matt Turner <matts...@gmail.com> wrote:
> On Wed, Jul 29, 2015 at 9:19 AM, Emil Velikov <emil.l.veli...@gmail.com> 
> wrote:
>> Strictly speaking the xcb_connection_has_error() might be sufficient,
>> yet the documentation does not mention what will happen if NULL is fed
>> to the function.
>>
>> Keep things explicit, which will allow us to remove the dri2_dpy->conn
>> checking with the next commit.
>
> Its implementation is
>
> int xcb_connection_has_error(xcb_connection_t *c)
> {
>     /* doesn't need locking because it's read and written atomically. */
>     return c->has_error;
> }
>
> so passing NULL is certainly not okay. :)
Nice find Matt. I've updated the commit message as follows:

The documentation of xcb_connection_has_error() does not mention
what will happen, if NULL is fed to the function.

Upon closer look (props to Matt), it seems that we'll crash as the
implementation dereferences conn.

This will also allow us to remove the dri2_dpy->conn checking with the
next commit.

v2: Reword commit message as per Matt's findings.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to