From c9004369b6a88f5e5c993f2c817c81d2fec9c85f Mon Sep 17 00:00:00 2001 From: miod Date: Sat, 17 May 2014 19:58:49 +0000 Subject: [PATCH] unchecked malloc() return value in OCSP_sendreq_new(). --- lib/libcrypto/ocsp/ocsp_ht.c | 2 ++ lib/libssl/src/crypto/ocsp/ocsp_ht.c | 2 ++ 2 files changed, 4 insertions(+) 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; -- 2.20.1