Skip to content

GH-22681: avoid truncation on null bytes in Reflection*::__toString()#22685

Merged
DanielEScherzer merged 3 commits into
php:PHP-8.4from
DanielEScherzer:reflection-null-bytes-r2
Jul 13, 2026
Merged

GH-22681: avoid truncation on null bytes in Reflection*::__toString()#22685
DanielEScherzer merged 3 commits into
php:PHP-8.4from
DanielEScherzer:reflection-null-bytes-r2

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Member

Fixes #22681

@DanielEScherzer

Copy link
Copy Markdown
Member Author

@Girgias let me know if it would be more helpful to split the fixes into separate commits

Comment thread ext/reflection/php_reflection.c Outdated
Comment thread ext/reflection/php_reflection.c Outdated
Comment thread ext/reflection/php_reflection.c Outdated
Comment thread ext/reflection/php_reflection.c
@DanielEScherzer DanielEScherzer force-pushed the reflection-null-bytes-r2 branch from 1e4e671 to a81df44 Compare July 13, 2026 19:39

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One final nit, but LGTM otherwise.

Comment thread ext/reflection/php_reflection.c
So that when the outputs are fixed the changes can be confirmed in tests
…ng()`

Given that there is not an unchecked version of `smart_str_append_printf()`, to
avoid compiler warnings from using `%S` to format `zend_string` pointers (which
the smart string printing machinery supports, but printf does not support) in a
few places the format specifier is declared in a variable rather than being
specified directly in the `smart_str_append_printf()` call.
@DanielEScherzer DanielEScherzer force-pushed the reflection-null-bytes-r2 branch from a81df44 to 8706cd4 Compare July 13, 2026 21:09
@DanielEScherzer

Copy link
Copy Markdown
Member Author

Rebased on top of latest changes, I'll merge this locally so that the commits stay signed

@DanielEScherzer DanielEScherzer merged commit 4804d17 into php:PHP-8.4 Jul 13, 2026
17 of 18 checks passed
@DanielEScherzer DanielEScherzer deleted the reflection-null-bytes-r2 branch July 13, 2026 21:27
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.

2 participants