Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ PHP NEWS
(Weilin Du)
. getenv() and putenv() now raises a ValueError when the first argument
contains null bytes. (Weilin Du)
. dl() now raises a ValueError when the $extension_filename argument
contains null bytes. (Weilin Du)
. parse_str() now raises a ValueError when the $string argument contains
null bytes. (Weilin Du)
. proc_open() now raises a ValueError when the $cwd argument contains
Expand Down
2 changes: 2 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ PHP 8.6 UPGRADE NOTES
argument value is passed.
. getenv() and putenv() now raises a ValueError when the first argument
contains null bytes.
. dl() now raises a ValueError when the $extension_filename argument
contains null bytes.
. parse_str() now raises a ValueError when the $string argument contains
null bytes.
. linkinfo() now raises a ValueError when the $path argument is empty.
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/dl.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ PHPAPI PHP_FUNCTION(dl)
size_t filename_len;

ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STRING(filename, filename_len)
Z_PARAM_PATH(filename, filename_len)
ZEND_PARSE_PARAMETERS_END();

if (!PG(enable_dl)) {
Expand Down
14 changes: 14 additions & 0 deletions ext/standard/tests/general_functions/dl_null_bytes.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
dl() rejects null bytes in extension filename
--FILE--
<?php

try {
dl("foo\0bar");
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}

?>
--EXPECT--
dl(): Argument #1 ($extension_filename) must not contain any null bytes
Loading