projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cd8a0ec
)
ssl_store_cert(): Check BIO_get_mem_data() return code
author
Fabian Keil
<fk@fabiankeil.de>
Tue, 5 Jan 2021 00:12:04 +0000
(
01:12
+0100)
committer
Fabian Keil
<fk@fabiankeil.de>
Sun, 10 Jan 2021 15:48:22 +0000
(16:48 +0100)
openssl.c
patch
|
blob
|
history
diff --git
a/openssl.c
b/openssl.c
index
ecfb6bf
..
e3717af
100644
(file)
--- 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)
{