[gnutls-dev] [PATCH] Fixing OpenPGP keyring import (again)

Timo Schulz twoaday at gmx.net
Tue May 22 13:52:06 CEST 2007


Ludovic Courtes wrote:

>>>   err = cdk_stream_tmp_from_mem (data->data, data->size, &input);
>>>   if (!err)
>>>     err = cdk_stream_set_armor_flag (input, 0);
>>>   if (!err)
>>>     err = cdk_keydb_new_from_stream (&keyring->db, 0, input);  

if cdk_stream_tmp_from_mem returns != 0 the
"if (!err)" expression fails and the keydb function is not called.


> `cdk_keydb_new_from_stream ()' does not always initialize INPUT to NULL
> on error, at least not in the OpenCDK currently available in HEAD:

That's right, but with the current code cdk_keydb_new_from_stream is
never called. It would be only called if there is _no_ error!


> And `cdk_stream_close ()' returns an error if STREAM is NULL:
[snip]
> Well, we don't check its return value...

The patch is not very elegant, it works but I guess I shall
cleanup it up.


Thanks,

	Timo




More information about the Gnutls-dev mailing list