]> granicus.if.org Git - php/commit
Fix binary-safety of parse_url
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 2 Sep 2020 14:43:00 +0000 (16:43 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 2 Sep 2020 14:45:25 +0000 (16:45 +0200)
commit54dbd3eccc867f456f257ce11556b50fcbee2ccf
treeec4b61f9cecc86f3cb7d20bbfe2fb73c413fc756
parent2e9e706a8271bbb42ad696c3383912facdd7d45f
Fix binary-safety of parse_url

php_parse_url() is intended to support strings that are not zero
terminated. We can't use strcspn in the implementation.

As we have two uses of strcspn, add a helper.
12 files changed:
ext/standard/tests/url/parse_url_basic_001.phpt
ext/standard/tests/url/parse_url_basic_002.phpt
ext/standard/tests/url/parse_url_basic_003.phpt
ext/standard/tests/url/parse_url_basic_004.phpt
ext/standard/tests/url/parse_url_basic_005.phpt
ext/standard/tests/url/parse_url_basic_006.phpt
ext/standard/tests/url/parse_url_basic_007.phpt
ext/standard/tests/url/parse_url_basic_008.phpt
ext/standard/tests/url/parse_url_basic_009.phpt
ext/standard/tests/url/parse_url_unterminated.phpt
ext/standard/tests/url/urls.inc
ext/standard/url.c