diff options
author | Josh Rickmar <jrick@conformal.com> | 2013-06-25 13:15:38 -0400 |
---|---|---|
committer | Josh Rickmar <jrick@conformal.com> | 2013-06-25 13:15:38 -0400 |
commit | c3b24f19eea3ab03d6d4a150fb054a2feb0735e7 (patch) | |
tree | 38dce9f99dc9bc81ecb1bae2df6b17f7dabaf715 | |
parent | 848866ed4446a47ebbca2a7862430ab43dbda5e6 (diff) | |
download | xombrero-c3b24f19eea3ab03d6d4a150fb054a2feb0735e7.tar.gz |
Be sure not to malloc nothing
-rw-r--r-- | xombrero.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xombrero.c b/xombrero.c index 350b762..631016e 100644 --- a/xombrero.c +++ b/xombrero.c @@ -1712,6 +1712,10 @@ save_certs(struct tab *t, gnutls_x509_crt_t *certs, cert_buf_sz = 0; gnutls_x509_crt_export(certs[i], GNUTLS_X509_FMT_PEM, NULL, &cert_buf_sz); + if (cert_buf_sz == 0) { + show_oops(t, "no certs found"); + goto done; + } cert_buf = gnutls_malloc(cert_buf_sz * sizeof(char)); if (cert_buf == NULL) { show_oops(t, "gnutls_x509_crt_export failed"); |