summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2014-05-18 16:18:13 +0000
committermiod <miod@openbsd.org>2014-05-18 16:18:13 +0000
commita0f5415429c64f969c4469037ad639ad1cf29ae6 (patch)
tree465743ae5678eab47a2b3dc24e52c1bbebd19516 /lib/libssl/src
parentIn dtls1_reassemble_fragment() and dtls1_process_out_of_seq_message(), in case (diff)
downloadwireguard-openbsd-a0f5415429c64f969c4469037ad639ad1cf29ae6.tar.xz
wireguard-openbsd-a0f5415429c64f969c4469037ad639ad1cf29ae6.zip
In OCSP_sendreq_bio(), cope with OCSP_sendreq_new() returning NULL.
ok jsing@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/ocsp/ocsp_ht.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libssl/src/crypto/ocsp/ocsp_ht.c b/lib/libssl/src/crypto/ocsp/ocsp_ht.c
index f3ee29ccbb0..3e7c2e46d00 100644
--- a/lib/libssl/src/crypto/ocsp/ocsp_ht.c
+++ b/lib/libssl/src/crypto/ocsp/ocsp_ht.c
@@ -161,7 +161,7 @@ OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, int maxline)
rctx = malloc(sizeof(OCSP_REQ_CTX));
if (rctx == NULL)
- return 0;
+ return NULL;
rctx->state = OHS_ERROR;
rctx->mem = BIO_new(BIO_s_mem());
rctx->io = io;
@@ -174,7 +174,7 @@ OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, int maxline)
if (!rctx->iobuf) {
BIO_free(rctx->mem);
free(rctx);
- return 0;
+ return NULL;
}
if (!path)
path = "/";
@@ -183,14 +183,14 @@ OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, int maxline)
free(rctx->iobuf);
BIO_free(rctx->mem);
free(rctx);
- return 0;
+ return NULL;
}
if (req && !OCSP_REQ_CTX_set1_req(rctx, req)) {
free(rctx->iobuf);
BIO_free(rctx->mem);
free(rctx);
- return 0;
+ return NULL;
}
return rctx;
@@ -453,6 +453,8 @@ OCSP_sendreq_bio(BIO *b, char *path, OCSP_REQUEST *req)
int rv;
ctx = OCSP_sendreq_new(b, path, req, -1);
+ if (ctx == NULL)
+ return NULL;
do {
rv = OCSP_sendreq_nbio(&resp, ctx);