Skip to content

Commit 8f8d2a4

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: uri: Fix RFC3986 to_string implementation with ExcludeFragment returning non-terminated strings (php#20811)
2 parents ac4e3cd + 3f7bfaf commit 8f8d2a4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/uri/uri_parser_rfc3986.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ ZEND_ATTRIBUTE_NONNULL static zend_string *php_uri_parser_rfc3986_to_string(void
595595
const char *pos = zend_memrchr(ZSTR_VAL(uri_string), '#', ZSTR_LEN(uri_string));
596596
if (pos != NULL) {
597597
uri_string = zend_string_truncate(uri_string, (pos - ZSTR_VAL(uri_string)), false);
598+
ZSTR_VAL(uri_string)[ZSTR_LEN(uri_string)] = '\0';
598599
}
599600
}
600601

0 commit comments

Comments
 (0)