summaryrefslogtreecommitdiff
path: root/lib/libcrypto/ocsp
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-05-18 16:18:14 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-05-18 16:18:14 +0000
commit74570a00ac92c0202b8640f1adf5b4630422faf4 (patch)
treefe26dfdbc1340d6094d79022d64b6cf65c09aadb /lib/libcrypto/ocsp
parent7e6b90433a7edba1b5c0bb26de6b40e7d1ecb770 (diff)
In OCSP_sendreq_bio(), cope with OCSP_sendreq_new() returning NULL.
ok jsing@
Diffstat (limited to 'lib/libcrypto/ocsp')
-rw-r--r--lib/libcrypto/ocsp/ocsp_ht.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libcrypto/ocsp/ocsp_ht.c b/lib/libcrypto/ocsp/ocsp_ht.c
index f3ee29ccbb0..3e7c2e46d00 100644
--- a/lib/libcrypto/ocsp/ocsp_ht.c
+++ b/lib/libcrypto/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);