[PATCH] Skip damage calls if DamageCreate fails in exa functions

Michel Dänzer michel at daenzer.net
Wed Sep 4 03:36:15 PDT 2013


On Die, 2013-09-03 at 10:35 -0700, Alan Coopersmith wrote:
> Fixes parfait errors such as:
>    Null pointer dereference (CWE 476): Write to null pointer pDamage
>         at line 1833 of miext/damage/damage.c in function 'DamageRegister'.
>           Function DamageCreate may return constant 'NULL' at line 1775,
>               called at line 232 of exa/exa_migration_mixed.c
>               in function 'exaPrepareAccessReg_mixed'.
>           Constant 'NULL' passed into function DamageRegister,
>               argument pDamage, from call at line 237.
>           Null pointer introduced at line 1775 of miext/damage/damage.c
>               in function 'DamageCreate'.
>    Null pointer dereference (CWE 476): Write to null pointer pDamage
>         at line 1833 of miext/damage/damage.c in function 'DamageRegister'.
>           Function DamageCreate may return constant 'NULL' at line 1775,
>               called at line 104 of exa/exa_mixed.c
>               in function 'exaCreatePixmap_mixed'.
>           Constant 'NULL' passed into function DamageRegister,
>               argument pDamage, from call at line 109.
>           Null pointer introduced at line 1775 of miext/damage/damage.c
>               in function 'DamageCreate'.
> 
> Checks are similar to handling results of other calls to DamageCreate.
> 
> [ This bug was found by the Parfait 1.3.0 bug checking tool.
>   http://labs.oracle.com/pls/apex/f?p=labs:49:::::P49_PROJECT_ID:13 ]
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer



More information about the xorg-devel mailing list