[PATCH] wolfSSL TLS layer: Check NULL return from wolfSSL_sk_value

Jouni Malinen j at w1.fi
Sun Oct 11 04:03:34 EDT 2020


On Tue, Aug 25, 2020 at 12:01:10PM +1000, Sean Parkinson wrote:
> diff --git a/src/crypto/tls_wolfssl.c b/src/crypto/tls_wolfssl.c
> @@ -585,7 +585,7 @@ static int tls_match_alt_subject_component(WOLFSSL_X509 *cert, int type,
>  
>  	for (i = 0; ext && i < wolfSSL_sk_num(ext); i++) {
>  		gen = wolfSSL_sk_value(ext, i);
> -		if (gen->type != type)
> +		if (gen == NULL || gen->type != type)
>  			continue;
...

These were already covered by the earlier "Fix wrong types in
tls_wolfssl.c" patch (*), so I'm dropping this separate patch just for
the NULL checks.

(*) http://patchwork.ozlabs.org/project/hostap/patch/20200804094823.59816-1-juliusz@wolfssl.com/

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list