msi: Avoid a potential NULL pointer dereference (coccicheck).

Paul Vriens paul.vriens.wine at gmail.com
Thu May 20 01:04:02 CDT 2010


On 05/20/2010 07:55 AM, Paul Vriens wrote:
> On 05/20/2010 01:15 AM, Michael Stefaniuc wrote:
>> The last "goto done" is for si == NULL. When MSI_GetSummaryInformationW
>> returns NULL there is a crash.
>> ---
>> dlls/msi/msi.c | 3 ++-
>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
>> index 3170e6d..9c08d1b 100644
>> --- a/dlls/msi/msi.c
>> +++ b/dlls/msi/msi.c
>> @@ -551,7 +551,8 @@ static UINT MSI_ApplicablePatchW( MSIPACKAGE
>> *package, LPCWSTR patch )
>>
>> done:
>> msiobj_release(&patch_db->hdr );
>> - msiobj_release(&si->hdr );
>> + if (si)
>> + msiobj_release(&si->hdr );
>> return r;
>> }
>>
>
> Hi Michael,
>
> This one is mentioned by Coverity (#970). Marcus marked this one as
> 'FALSE' with the remark:
>
> "hdr is at position 0, so this will be NULL and msiobj_release handles it."
>
> Thoughts?
>

The main reason I'm asking is because we have several of these lingering 
around (and marked as 'FALSE' in Coverity).

-- 
Cheers,

Paul.



More information about the wine-devel mailing list