diff options
author | Simon Josefsson <simon@josefsson.org> | 2007-04-10 08:53:28 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2007-04-10 08:53:28 +0000 |
commit | 9cf0a597203099bf4fa2a4bcf4e7204ef9fdac3e (patch) | |
tree | 4cf4fe2c24391974d3bc8fac7ea2c4021372f126 /libextra | |
parent | 2bc94f8b34ec8fed3653ff34b5f1836326d93f9a (diff) | |
download | gnutls-9cf0a597203099bf4fa2a4bcf4e7204ef9fdac3e.tar.gz |
(gnutls_certificate_set_openpgp_key): Allocate certificate structure
properly. Tiny patch from ludo@chbouib.org (Ludovic Courtès).
Diffstat (limited to 'libextra')
-rw-r--r-- | libextra/gnutls_openpgp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libextra/gnutls_openpgp.c b/libextra/gnutls_openpgp.c index e9967cd6e3..b76f57aa90 100644 --- a/libextra/gnutls_openpgp.c +++ b/libextra/gnutls_openpgp.c @@ -1257,7 +1257,13 @@ gnutls_certificate_set_openpgp_key (gnutls_certificate_credentials_t 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); |