OpenSSL: Fix possible null pointer dereference on an OCSP error path

Fix possible null pointer dereference in check_ocsp_resp() if an memory
allocation fails.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
This commit is contained in:
Ayala Beker 2016-01-25 12:28:46 +02:00 committed by Jouni Malinen
parent a3cc64f3d2
commit 443c8e18de

View file

@ -562,6 +562,8 @@ enum ocsp_result check_ocsp_resp(SSL_CTX *ssl_ctx, SSL *ssl, X509 *cert,
if (basic->certs) {
untrusted = sk_X509_dup(basic->certs);
if (!untrusted)
goto fail;
num = sk_X509_num(basic->certs);
for (i = 0; i < num; i++) {