This is an automated email from the ASF dual-hosted git repository.
JosiahWI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new d70bdb7035 Fix bad return in `validate_hostname` (#13498)
d70bdb7035 is described below
commit d70bdb703519d5ca9828803c362e3723cbac7130
Author: JosiahWI <[email protected]>
AuthorDate: Wed Aug 5 11:22:41 2026 -0500
Fix bad return in `validate_hostname` (#13498)
The function has a `bool` return type, but returned `-1` to indicate an
error
on UTF-8 conversion failure. This patch corrects the return statement to
return `false`.
---
src/tscore/X509HostnameValidator.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tscore/X509HostnameValidator.cc
b/src/tscore/X509HostnameValidator.cc
index 0efbcac99d..5d98b73f05 100644
--- a/src/tscore/X509HostnameValidator.cc
+++ b/src/tscore/X509HostnameValidator.cc
@@ -281,7 +281,7 @@ validate_hostname(X509 *x, std::string_view hostname, bool
is_ip, char **peernam
astrlen = ASN1_STRING_to_UTF8(&astr, str);
if (astrlen < 0) {
- return -1;
+ return false;
}
retval = equal(astr, astrlen, hostname_data, hostname_len);
if (retval && peername) {