From: miod Date: Sat, 17 May 2014 19:58:49 +0000 (+0000) Subject: unchecked malloc() return value in OCSP_sendreq_new(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c9004369b6a88f5e5c993f2c817c81d2fec9c85f;p=openbsd unchecked malloc() return value in OCSP_sendreq_new(). --- diff --git a/lib/libcrypto/ocsp/ocsp_ht.c b/lib/libcrypto/ocsp/ocsp_ht.c index fe4a7a1a72d..7f73a4195cf 100644 --- a/lib/libcrypto/ocsp/ocsp_ht.c +++ b/lib/libcrypto/ocsp/ocsp_ht.c @@ -160,6 +160,8 @@ OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, int maxline) OCSP_REQ_CTX *rctx; rctx = malloc(sizeof(OCSP_REQ_CTX)); + if (rctx == NULL) + return 0; rctx->state = OHS_ERROR; rctx->mem = BIO_new(BIO_s_mem()); rctx->io = io; diff --git a/lib/libssl/src/crypto/ocsp/ocsp_ht.c b/lib/libssl/src/crypto/ocsp/ocsp_ht.c index fe4a7a1a72d..7f73a4195cf 100644 --- a/lib/libssl/src/crypto/ocsp/ocsp_ht.c +++ b/lib/libssl/src/crypto/ocsp/ocsp_ht.c @@ -160,6 +160,8 @@ OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, int maxline) OCSP_REQ_CTX *rctx; rctx = malloc(sizeof(OCSP_REQ_CTX)); + if (rctx == NULL) + return 0; rctx->state = OHS_ERROR; rctx->mem = BIO_new(BIO_s_mem()); rctx->io = io;