File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -254,6 +254,8 @@ PHP NEWS
254254 (Weilin Du)
255255 . getenv() and putenv() now raises a ValueError when the first argument
256256 contains null bytes. (Weilin Du)
257+ . dl() now raises a ValueError when the $extension_filename argument
258+ contains null bytes. (Weilin Du)
257259 . parse_str() now raises a ValueError when the $string argument contains
258260 null bytes. (Weilin Du)
259261 . proc_open() now raises a ValueError when the $cwd argument contains
Original file line number Diff line number Diff line change @@ -151,6 +151,8 @@ PHP 8.6 UPGRADE NOTES
151151 argument value is passed.
152152 . getenv() and putenv() now raises a ValueError when the first argument
153153 contains null bytes.
154+ . dl() now raises a ValueError when the $extension_filename argument
155+ contains null bytes.
154156 . parse_str() now raises a ValueError when the $string argument contains
155157 null bytes.
156158 . linkinfo() now raises a ValueError when the $path argument is empty.
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ PHPAPI PHP_FUNCTION(dl)
4343 size_t filename_len ;
4444
4545 ZEND_PARSE_PARAMETERS_START (1 , 1 )
46- Z_PARAM_STRING (filename , filename_len )
46+ Z_PARAM_PATH (filename , filename_len )
4747 ZEND_PARSE_PARAMETERS_END ();
4848
4949 if (!PG (enable_dl )) {
Original file line number Diff line number Diff line change 1+ --TEST--
2+ dl() rejects null bytes in extension filename
3+ --FILE--
4+ <?php
5+
6+ try {
7+ dl ("foo \0bar " );
8+ } catch (ValueError $ e ) {
9+ echo $ e ->getMessage (), "\n" ;
10+ }
11+
12+ ?>
13+ --EXPECT--
14+ dl(): Argument #1 ($extension_filename) must not contain any null bytes
You can’t perform that action at this time.
0 commit comments