Repository navigation
ext/standard: Minor NUL byte rejection fixes - #25171
LamentXU123 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
The version_compare() part looks g2g, php_version_compare() works on C strings so rejecting is the only sane option. I'd split it into its own PR so it can land while quoted_printable_decode() gets reworked.
For quoted_printable_decode() I'd rather fix the truncation than reject. The decoder already passes through everything else that isn't valid QP, =00 decodes to a NUL anyway, and the convert.quoted-printable-decode filter keeps a raw NUL: "abc\0d=41f" gives abc\0dAf from the filter and abc from the function. Walking the input by ZSTR_LEN() instead of stopping at the terminator would make the two agree.
| try { | ||
| quoted_printable_decode($input); | ||
| } catch (ValueError $e) { | ||
| echo $e->getMessage(), "\n"; |
There was a problem hiding this comment.
nit: echo $e::class along with the message, same in version_compare_null_bytes.phpt.
Don't worry, I will rebase & merge so it will appears in different commit. |
d82f06d to
445282f
Compare
|
The mac test failure seems to be unrelated. |
This reject NUL bytes in parameters in quoted_printable_decode and version_compare function