diff options
author | tb <> | 2025-03-19 17:11:21 +0000 |
---|---|---|
committer | tb <> | 2025-03-19 17:11:21 +0000 |
commit | 8bb14039f52469491bf0058b1efdf0c75db6befc (patch) | |
tree | 4b95c7112f69690894727c63b5648945b28e8c65 /src/lib/libcrypto/x509/x509_vpm.c | |
parent | 168699d3fe8ffdabb6765e02f3e9f53a65823660 (diff) | |
download | openbsd-master.tar.gz openbsd-master.tar.bz2 openbsd-master.zip |
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/x509/x509_vpm.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/libcrypto/x509/x509_vpm.c b/src/lib/libcrypto/x509/x509_vpm.c index 24ea72b4fe..9efe473fc3 100644 --- a/src/lib/libcrypto/x509/x509_vpm.c +++ b/src/lib/libcrypto/x509/x509_vpm.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_vpm.c,v 1.54 2025/03/19 16:35:11 tb Exp $ */ | 1 | /* $OpenBSD: x509_vpm.c,v 1.55 2025/03/19 17:11:21 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2004. | 3 | * project 2004. |
4 | */ | 4 | */ |
@@ -113,7 +113,7 @@ sk_OPENSSL_STRING_deep_copy(const STACK_OF(OPENSSL_STRING) *sk) | |||
113 | } | 113 | } |
114 | 114 | ||
115 | static int | 115 | static int |
116 | x509_param_set_hosts_internal(X509_VERIFY_PARAM *vpm, int mode, | 116 | x509_param_set_hosts_internal(X509_VERIFY_PARAM *param, int mode, |
117 | const char *name, size_t namelen) | 117 | const char *name, size_t namelen) |
118 | { | 118 | { |
119 | char *copy; | 119 | char *copy; |
@@ -126,9 +126,9 @@ x509_param_set_hosts_internal(X509_VERIFY_PARAM *vpm, int mode, | |||
126 | if (name && memchr(name, '\0', namelen)) | 126 | if (name && memchr(name, '\0', namelen)) |
127 | return 0; | 127 | return 0; |
128 | 128 | ||
129 | if (mode == SET_HOST && vpm->hosts) { | 129 | if (mode == SET_HOST && param->hosts) { |
130 | sk_OPENSSL_STRING_pop_free(vpm->hosts, str_free); | 130 | sk_OPENSSL_STRING_pop_free(param->hosts, str_free); |
131 | vpm->hosts = NULL; | 131 | param->hosts = NULL; |
132 | } | 132 | } |
133 | if (name == NULL || namelen == 0) | 133 | if (name == NULL || namelen == 0) |
134 | return 1; | 134 | return 1; |
@@ -136,17 +136,17 @@ x509_param_set_hosts_internal(X509_VERIFY_PARAM *vpm, int mode, | |||
136 | if (copy == NULL) | 136 | if (copy == NULL) |
137 | return 0; | 137 | return 0; |
138 | 138 | ||
139 | if (vpm->hosts == NULL && | 139 | if (param->hosts == NULL && |
140 | (vpm->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { | 140 | (param->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { |
141 | free(copy); | 141 | free(copy); |
142 | return 0; | 142 | return 0; |
143 | } | 143 | } |
144 | 144 | ||
145 | if (!sk_OPENSSL_STRING_push(vpm->hosts, copy)) { | 145 | if (!sk_OPENSSL_STRING_push(param->hosts, copy)) { |
146 | free(copy); | 146 | free(copy); |
147 | if (sk_OPENSSL_STRING_num(vpm->hosts) == 0) { | 147 | if (sk_OPENSSL_STRING_num(param->hosts) == 0) { |
148 | sk_OPENSSL_STRING_free(vpm->hosts); | 148 | sk_OPENSSL_STRING_free(param->hosts); |
149 | vpm->hosts = NULL; | 149 | param->hosts = NULL; |
150 | } | 150 | } |
151 | return 0; | 151 | return 0; |
152 | } | 152 | } |