Skip to content

uri: Fix RFC3986 to_string implementation with ExcludeFragment returning non-terminated strings#20811

Merged
ndossche merged 1 commit intophp:PHP-8.5from
ndossche:uri-nuls
Jan 2, 2026
Merged

uri: Fix RFC3986 to_string implementation with ExcludeFragment returning non-terminated strings#20811
ndossche merged 1 commit intophp:PHP-8.5from
ndossche:uri-nuls

Conversation

@ndossche
Copy link
Copy Markdown
Member

zend_string_truncate() doesn't put a NUL byte.
Right now this doesn't matter as this code path is only hittable via the equals() method, but if other extension (or future other code) starts using this code path, then it can be problematic as all user-exposed zend_strings need to end with a NUL byte.

…ing non-terminated strings

zend_string_truncate() doesn't put a NUL byte.
Right now this doesn't matter as this code path is only hittable via the
equals() method, but if other extension (or future other code) starts
using this code path, then it can be problematic as all user-exposed
zend_strings need to end with a NUL byte.
@ndossche ndossche merged commit 3f7bfaf into php:PHP-8.5 Jan 2, 2026
10 checks passed
ndossche added a commit that referenced this pull request Jan 2, 2026
* PHP-8.5:
  uri: Fix RFC3986 to_string implementation with ExcludeFragment returning non-terminated strings (#20811)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants