X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=openssl.c;h=e3717af5db842e5135a0e2e0d60694c1613f061c;hp=ecfb6bf8ed3f38d72838a91803fb174be05a676c;hb=c0def7e7a0e43f3a907e96391937817e8912d230;hpb=3b4813587fa2eab6daed2738f455a7145fb31f1e diff --git a/openssl.c b/openssl.c index ecfb6bf8..e3717af5 100644 --- a/openssl.c +++ b/openssl.c @@ -654,6 +654,13 @@ static int ssl_store_cert(struct client_state *csp, X509* crt) BIO_write(bio, &zero, 1); len = BIO_get_mem_data(bio, &bio_mem_data); + if (len <= 0) + { + log_error(LOG_LEVEL_ERROR, "BIO_get_mem_data() returned %d " + "while gathering certificate information", len); + ret = -1; + goto exit; + } encoded_text = html_encode(bio_mem_data); if (encoded_text == NULL) {