Skip to content
Open
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 @@ -257,6 +257,8 @@ PHP NEWS
contains null bytes. (Weilin Du)
. dl() now raises a ValueError when the $extension_filename argument
contains null bytes. (Weilin Du)
. openlog() now raises a ValueError when the $prefix 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 @@ -153,6 +153,8 @@ PHP 8.6 UPGRADE NOTES
contains null bytes.
. dl() now raises a ValueError when the $extension_filename argument
contains null bytes.
. openlog() now raises a ValueError when the $prefix 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/syslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ PHP_FUNCTION(openlog)
size_t ident_len;

ZEND_PARSE_PARAMETERS_START(3, 3)
Z_PARAM_STRING(ident, ident_len)
Z_PARAM_PATH(ident, ident_len)
Z_PARAM_LONG(option)
Z_PARAM_LONG(facility)
ZEND_PARSE_PARAMETERS_END();
Expand Down
16 changes: 16 additions & 0 deletions ext/standard/tests/network/openlog_null_bytes.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--TEST--
openlog() rejects null bytes in prefix
--SKIPIF--
<?php
if (!function_exists("openlog")) die("skip openlog() is not available");
?>
--FILE--
<?php
try {
openlog("foo\0bar", LOG_NDELAY, LOG_USER);
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
openlog(): Argument #1 ($prefix) must not contain any null bytes
Loading