diff options
author | tb <> | 2022-08-31 07:15:31 +0000 |
---|---|---|
committer | tb <> | 2022-08-31 07:15:31 +0000 |
commit | 1af840db6160c4511f1e225122056a69d23d80cd (patch) | |
tree | 88f5b5602ade55484690aaa6189a95822613e5a9 /src | |
parent | 77eac0ad9b595b925f07dc5b13a0538ec6557aba (diff) | |
download | openbsd-1af840db6160c4511f1e225122056a69d23d80cd.tar.gz openbsd-1af840db6160c4511f1e225122056a69d23d80cd.tar.bz2 openbsd-1af840db6160c4511f1e225122056a69d23d80cd.zip |
Switch loop bounds from size_t to int in check_hosts()
sk_num() can return a negative value, in which case the upper bound is
SIZE_MAX, which results in a very long for loop.
CID 153997
ok jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index 18cf08a07c..fb87877e72 100644 --- a/src/lib/libcrypto/x509/x509_vfy.c +++ b/src/lib/libcrypto/x509/x509_vfy.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_vfy.c,v 1.102 2022/06/27 14:10:22 tb Exp $ */ | 1 | /* $OpenBSD: x509_vfy.c,v 1.103 2022/08/31 07:15:31 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -186,7 +186,7 @@ check_id_error(X509_STORE_CTX *ctx, int errcode) | |||
186 | static int | 186 | static int |
187 | check_hosts(X509 *x, X509_VERIFY_PARAM_ID *id) | 187 | check_hosts(X509 *x, X509_VERIFY_PARAM_ID *id) |
188 | { | 188 | { |
189 | size_t i, n; | 189 | int i, n; |
190 | char *name; | 190 | char *name; |
191 | 191 | ||
192 | n = sk_OPENSSL_STRING_num(id->hosts); | 192 | n = sk_OPENSSL_STRING_num(id->hosts); |