[gnutls-devel] Use of gnutls_x509_trust_list_add_cas() function

Nikos Mavrogiannopoulos nmav at gnutls.org
Wed Apr 9 11:00:46 CEST 2014


On Tue, Apr 8, 2014 at 11:19 PM, Zaolin <zaolin at das-labor.org> wrote:
> Hi,
> yesterday I browsed the code of gnutls and found some strange behaviour
> in the check of a return value.The gnutls_x509_trust_list_add_cas
> function returns the elements which has been added to the trust list.
>  * Returns: The number of added elements is returned.
> But in the whole gnutls code including the apps the return value is
> checked like this:
> ret = gnutls_x509_trust_list_add_cas
> if( ret < 0 ) {
> The return value of this function can never be negative as the
> implementation shows. So it seems that this is a bug if I am right ?

Hello Zaolin,
 You are right. Feel free to submit a patch; the tricky part is
determining the uses of the function that require its return value be
non-zero.

regards,
Nikos



More information about the Gnutls-devel mailing list