Skip to content

Throw an error on null byte in curl array options#22662

Merged
Girgias merged 1 commit into
php:masterfrom
Sjord:curl-headers-nul-byte
Jul 10, 2026
Merged

Throw an error on null byte in curl array options#22662
Girgias merged 1 commit into
php:masterfrom
Sjord:curl-headers-nul-byte

Conversation

@Sjord

@Sjord Sjord commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

This is already done for string options in php_curl_option_str (see bug #68089). Similarly, array arguments should also not contain null bytes, so we throw the same error for these.

This was extracted from #22651, as this seems less controversial.

Using null bytes is clearly not supported and curl just throws away everything after the null byte, so
https://wiki.php.net/rfc/policy-exempt-type-value-error-bc-policy seems to apply here.

This is already done for string options in php_curl_option_str
(see bug #68089). Similarly, array arguments should also not contain
null bytes, so we throw the same error for these.

This was extracted from php#22651, as
this seems less controversial.

Using null bytes is clearly not supported and curl just throws away
everything after the null byte, so
https://wiki.php.net/rfc/policy-exempt-type-value-error-bc-policy seems
to apply here.
@Girgias Girgias merged commit d1d144e into php:master Jul 10, 2026
18 checks passed
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.

3 participants