From: Nikita Popov Date: Wed, 2 Sep 2020 14:46:49 +0000 (+0200) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bc2657b2f59f39d785214107aefcd7b374290c5;p=php Merge branch 'PHP-7.4' * PHP-7.4: Fix binary-safety of parse_url --- 0bc2657b2f59f39d785214107aefcd7b374290c5 diff --cc ext/standard/url.c index b149ca0580,3b12e3171f..f710b2fe8a --- a/ext/standard/url.c +++ b/ext/standard/url.c @@@ -81,7 -87,19 +81,18 @@@ PHPAPI php_url *php_url_parse(char cons return php_url_parse_ex(str, strlen(str)); } + static const char *binary_strcspn(const char *s, const char *e, const char *chars) { + while (*chars) { + const char *p = memchr(s, *chars, e - s); + if (p) { + e = p; + } + chars++; + } + return e; + } + -/* {{{ php_url_parse - */ +/* {{{ php_url_parse */ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) { char port_buf[6];