Hello Paul,

Paul Vriens wrote:
> On 01/12/2010 02:32 PM, Michael Stefaniuc wrote:
>> Paul Vriens wrote:
>>> We already check and return FALSE a few lines up.
>>>
>>> Found with the help of Coccinelle and the CocciCheck scripts.
>>>
>>> Changelog
>>>    Don't check result twice (Coccinelle)
>>>
>> --- a/dlls/rsaenh/tests/rsaenh.c
>> +++ b/dlls/rsaenh/tests/rsaenh.c
>> @@ -275,7 +275,6 @@ static BOOL derive_key(ALG_ID aiAlgid, HCRYPTKEY
>> *phKey, DWORD len)
>>           return FALSE;
>>       }
>>       ok(result, "%08x\n", GetLastError());
>> -    if (!result) return FALSE;
             ^^^ old result value
>>       result = CryptHashData(hHash, pbData, sizeof(pbData), 0);
         ^^^ new result value
>>       ok(result, "%08x\n", GetLastError());
>>       if (!result) return FALSE;
>> that is not the same "result"; it gets a new value after the first
>> "return FALSE".
> 
> Where?
> 
> The only thing between the "return FALSE;" and the "if (!result)" is an
> ok() statement.
I see a "result = CryptHashData()" in between.

bye
        michael


-- 
Michael Stefaniuc                           Tel.: +49-711-96437-199
Consulting Communications Engineer          Fax.: +49-711-96437-111
--------------------------------------------------------------------
Reg. Adresse: Red Hat GmbH, Otto-Hahn-Strasse 20, 85609 Dornach
Handelsregister: Amtsgericht Muenchen HRB 153243
Geschäftsführer: Brendan Lane, Charlie Peters, Michael Cunningham,
                 Charles Cachera


Reply via email to