[Mesa-dev] [PATCH] gbm: avoid null pointer dereference

Mun, Gwan-gyeong elongbug at gmail.com
Mon Jul 17 14:43:53 UTC 2017


Thanks Daniel for a detailed explain with link, that was totally my
misunderstood.  ignore this patch ^^.

2017-07-17 23:20 GMT+09:00 Daniel Stone <daniel at fooishbar.org>:
> Hi,
>
> On 17 July 2017 at 15:02, Gwan-gyeong Mun <elongbug at gmail.com> wrote:
>> gbm_dri_surface_create() might create gbm_surface without modifiers.
>> therefore, gbm_dri_surface_destroy() needs to check modifiers is null or not
>> prior to free it.
>
> This is not true. The code here does not perform a dereference of
> surf->base.modifiers (the only dereference occurs on surf). free()
> itself is explicitly specified to be safe when passing NULL:
> 'If ptr is a null pointer, no action shall occur.'
>http://pubs.opengroup.org/onlinepubs/009695399/functions/free.html
>
> Cheers,
> Daniel



-- 
Gwan-gyeong Mun


More information about the mesa-dev mailing list