We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d64a4e commit 648b0a5Copy full SHA for 648b0a5
1 file changed
src/x509.c
@@ -463,10 +463,12 @@ int wolfSSL_X509_get_ext_by_OBJ(const WOLFSSL_X509 *x,
463
lastpos++;
464
if (lastpos < 0)
465
lastpos = 0;
466
- for (; lastpos < wolfSSL_sk_num(sk); lastpos++)
467
- if (wolfSSL_OBJ_cmp(wolfSSL_sk_X509_EXTENSION_value(sk,
468
- lastpos)->obj, obj) == 0)
+ for (; lastpos < wolfSSL_sk_num(sk); lastpos++) {
+ WOLFSSL_X509_EXTENSION* ext = wolfSSL_sk_X509_EXTENSION_value(sk,
+ lastpos);
469
+ if (ext != NULL && wolfSSL_OBJ_cmp(ext->obj, obj) == 0)
470
return lastpos;
471
+ }
472
return WOLFSSL_FATAL_ERROR;
473
}
474
0 commit comments