mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix signedness confusion in php_filter_validate_domain()
As is, there is the possibility that integer underflow occurs, making `_php_filter_validate_domain()` succeed for very long domain names. Cf. <https://pwning.systems/posts/php_filter_var_shenanigans/>.
This commit is contained in:
parent
aa352c2c54
commit
771dbdb319
2 changed files with 4 additions and 1 deletions
3
NEWS
3
NEWS
|
@ -8,6 +8,9 @@ PHP NEWS
|
|||
(Tim Düsterhus)
|
||||
. Fixed bug GH-8160 (ZTS support on Alpine is broken). (Michael Voříšek)
|
||||
|
||||
- Filter:
|
||||
. Fixed signedness confusion in php_filter_validate_domain(). (cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug GH-8142 (Compilation error on cygwin). (David Carlier)
|
||||
|
||||
|
|
|
@ -496,7 +496,7 @@ void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
|||
}
|
||||
}
|
||||
|
||||
static int _php_filter_validate_domain(char * domain, int len, zend_long flags) /* {{{ */
|
||||
static int _php_filter_validate_domain(char * domain, size_t len, zend_long flags) /* {{{ */
|
||||
{
|
||||
char *e, *s, *t;
|
||||
size_t l;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue