Skip to content

Commit 95f8d74

Browse files
ColtonWilleydouzzer
authored andcommitted
Fix loop to decrement
1 parent 96138e7 commit 95f8d74

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/x509_str.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,14 @@ int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX* ctx)
365365
(wolfSSL_sk_X509_num(certs) > numInterAdd)) {
366366
for (i = wolfSSL_sk_X509_num(certs) - 1;
367367
i > (numInterAdd > 0 ? numInterAdd - 1 : 0);
368-
i++) {
368+
i--) {
369369
tmp = wolfSSL_sk_X509_value(certs, i);
370-
if (wolfSSL_X509_NAME_cmp(
370+
if (tmp != NULL && wolfSSL_X509_NAME_cmp(
371371
&issuer->subject, &tmp->subject) == 0) {
372372
ret = WOLFSSL_SUCCESS;
373373
break;
374374
}
375+
tmp = NULL;
375376
}
376377
}
377378
}

0 commit comments

Comments
 (0)