summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2013-07-31 14:21:04 +0000
committerjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2013-07-31 14:21:04 +0000
commit56f83ae2091ee5197a69f98233ae5dbf7b59e8c4 (patch)
tree92219ce690e682908c0da035c0e1b0593412b3e1 /src
parent841b9e95a7f15744beab818eb43825f1b37ad7d5 (diff)
downloadneon-56f83ae2091ee5197a69f98233ae5dbf7b59e8c4.tar.gz
* src/ne_gnutls.c (x509_crt_copy, make_peers_chain): Fix potential segv,
patch by Matthias Petschick. git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@1918 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'src')
-rw-r--r--src/ne_gnutls.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ne_gnutls.c b/src/ne_gnutls.c
index c382643..e7869a8 100644
--- a/src/ne_gnutls.c
+++ b/src/ne_gnutls.c
@@ -486,7 +486,7 @@ static ne_ssl_certificate *populate_cert(ne_ssl_certificate *cert,
static gnutls_x509_crt_t x509_crt_copy(gnutls_x509_crt_t src)
{
int ret;
- size_t size;
+ size_t size = 0;
gnutls_datum_t tmp;
gnutls_x509_crt_t dest;
@@ -777,6 +777,9 @@ static ne_ssl_certificate *make_peers_chain(gnutls_session_t sock,
if (issuer) {
issuer = x509_crt_copy(issuer);
+ if (issuer == NULL)
+ break;
+
cert = populate_cert(ne_calloc(sizeof *cert), issuer);
/* Check that the issuer does not match the current
* cert. */