summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2018-11-14 16:32:47 +0000
committerjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2018-11-14 16:32:47 +0000
commite3af24ed520db1bc6f3f7af3fdad7f99b4982ae7 (patch)
tree7c710b0caafe6a9fa10d4250b5f6114fe761ab58
parenta7fe338ba825085c610152d60d08fb6e88572b12 (diff)
downloadneon-e3af24ed520db1bc6f3f7af3fdad7f99b4982ae7.tar.gz
Merge r2042 from trunk:
* src/ne_gnutls.c (provide_client_cert): Fix allocation size, submitted by Henrik Holst. git-svn-id: http://svn.webdav.org/repos/projects/neon/branches/0.30.x@2044 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
-rw-r--r--NEWS1
-rw-r--r--src/ne_gnutls.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 25e827c..e8b6396 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
Changes in release 0.30.3:
* Fixes for OpenSSL 1.1.1 and TLSv1.3 support.
+* Fix for crash with GnuTLS in client cert support (Henrik Holst)
* Fix possible crash in ne_set_request_flag().
* Add more gcc "nonnull" attributes to ne_request_* functions.
diff --git a/src/ne_gnutls.c b/src/ne_gnutls.c
index a074fbf..f3e825e 100644
--- a/src/ne_gnutls.c
+++ b/src/ne_gnutls.c
@@ -660,7 +660,7 @@ static int provide_client_cert(gnutls_session_t session,
return ret;
}
- *pcert = gnutls_malloc(sizeof *pcert);
+ *pcert = gnutls_calloc(1, sizeof **pcert);
gnutls_pcert_import_x509(*pcert, sess->client_cert->cert.subject, 0);
*pcert_length = 1;
#else /* !HAVE_GNUTLS_CERTIFICATE_SET_RETRIEVE_FUNCTION2 */