[gnutls-dev] Buglet in `gnutls_certificate_set_openpgp_key ()'

Simon Josefsson simon at josefsson.org
Tue Apr 10 11:57:17 CEST 2007


ludo at chbouib.org (Ludovic Courtès) writes:

> Hi,
>
> The patch below fixes a (funny) bug in
> `gnutls_certificate_set_openpgp_key ()'.

Hi!  Looks correct to me (the old code never worked at all, right?).
Installed.

Thanks,
Simon

> Thanks,
> Ludovic.
>
> --- orig/libextra/gnutls_openpgp.c
> +++ mod/libextra/gnutls_openpgp.c
> @@ -1257,7 +1257,13 @@ gnutls_certificate_set_openpgp_key (gnut
>        return GNUTLS_E_MEMORY_ERROR;
>      }
>  
> -  res->cert_list[res->ncerts] = NULL;	/* for realloc */
> +  res->cert_list[res->ncerts] = gnutls_calloc (1, sizeof (gnutls_cert));
> +  if (res->cert_list[res->ncerts] == NULL)
> +    {
> +      gnutls_assert ();
> +      return GNUTLS_E_MEMORY_ERROR;
> +    }
> +
>    res->cert_list_length[res->ncerts] = 1;
>  
>    ret = _gnutls_openpgp_key_to_gcert (res->cert_list[res->ncerts], key);
>
> _______________________________________________
> Gnutls-dev mailing list
> Gnutls-dev at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnutls-dev




More information about the Gnutls-devel mailing list