Commit 67a89f6bf00 for php.net

commit 67a89f6bf0034f0bc70e0ab08fcb77c4f0443c22
Author: Gina Peter Banyard <girgias@php.net>
Date:   Wed Dec 24 17:28:27 2025 +0100

    ext/standard/mail.c: refactor php_mail_build_headers_check_field_name()

    Fix incorrect return type
    Use zend_string macros

diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index b8381be0626..0d1b34d7166 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -112,14 +112,13 @@ static php_mail_header_value_error_type php_mail_build_headers_check_field_value
 	return NO_HEADER_ERROR;
 }

-
-static bool php_mail_build_headers_check_field_name(const zend_string *key)
+static zend_result php_mail_build_headers_check_field_name(const zend_string *key)
 {
 	size_t len = 0;

 	/* https://tools.ietf.org/html/rfc2822#section-2.2 */
-	while (len < key->len) {
-		if (*(key->val+len) < 33 || *(key->val+len) > 126 || *(key->val+len) == ':') {
+	while (len < ZSTR_LEN(key)) {
+		if (*(ZSTR_VAL(key)+len) < 33 || *(ZSTR_VAL(key)+len) > 126 || *(ZSTR_VAL(key)+len) == ':') {
 			return FAILURE;
 		}
 		len++;