Skip to content

Commit 2c74614

Browse files
committed
Use simpler comparison
1 parent 42504f8 commit 2c74614

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crypto/x509/x509_vfy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) {
729729
}
730730
// Check pathlen if not self issued
731731
if (i > 1 && !(x->ex_flags & EXFLAG_SI) && x->ex_pathlen != -1 &&
732-
(x->ex_pathlen > LONG_MAX - 1 || plen > x->ex_pathlen + 1)) {
732+
plen - 1 > x->ex_pathlen) {
733733
ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED;
734734
ctx->error_depth = i;
735735
ctx->current_cert = x;

0 commit comments

Comments
 (0)