]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
HTTP: Fix OCSP error path
authorSubhani Shaik <subhanis@qca.qualcomm.com>
Tue, 17 Feb 2015 19:29:06 +0000 (11:29 -0800)
committerJouni Malinen <j@w1.fi>
Thu, 19 Feb 2015 11:29:55 +0000 (13:29 +0200)
If addition of a peer issuer certificate fails, the certs pointer would
be NULL when being passed to sk_X509_push() for peer issuer's issuer.
Fix this by skipping addition of issuer's issue if issuer addition
fails.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/utils/http_curl.c

index 0c18269da519909e9336b2b5c2fc906e3ccd5884..3a042f9324a4688f35d96346b8b4645365f95261 100644 (file)
@@ -1098,7 +1098,7 @@ static int ocsp_resp_cb(SSL *s, void *arg)
                                sk_X509_free(certs);
                                certs = NULL;
                        }
-                       if (ctx->peer_issuer_issuer) {
+                       if (certs && ctx->peer_issuer_issuer) {
                                cert = X509_dup(ctx->peer_issuer_issuer);
                                if (cert && !sk_X509_push(certs, cert)) {
                                        tls_show_errors(