]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
curl: Don't free memory for subjectAltName before calling callback
authorCedric Izoard <Cedric.Izoard@ceva-dsp.com>
Tue, 14 Jun 2016 12:49:00 +0000 (12:49 +0000)
committerJouni Malinen <j@w1.fi>
Sun, 19 Jun 2016 19:11:36 +0000 (22:11 +0300)
Freeing memory for subjectAltName in parse_cert(), will give cert_cb
pointers to freed memory zone that may already been overwritten. Memory
for subjectAltName is released in parse_cert_free().

Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
src/utils/http_curl.c

index d59439896ce8237b402145512e190c4ddd370098..a06aae8d9b9d0a4c65fcecfb6c7b2183c260efe2 100644 (file)
@@ -857,10 +857,8 @@ static void parse_cert(struct http_ctx *ctx, struct http_cert *hcert,
        os_memset(hcert, 0, sizeof(*hcert));
 
        *names = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL);
-       if (*names) {
+       if (*names)
                add_alt_names(ctx, hcert, *names);
-               sk_GENERAL_NAME_pop_free(*names, GENERAL_NAME_free);
-       }
 
        add_logotype_ext(ctx, hcert, cert);
 }