File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -257,6 +257,8 @@ PHP NEWS
257257 contains null bytes. (Weilin Du)
258258 . dl() now raises a ValueError when the $extension_filename argument
259259 contains null bytes. (Weilin Du)
260+ . openlog() now raises a ValueError when the $prefix argument contains
261+ null bytes. (Weilin Du)
260262 . parse_str() now raises a ValueError when the $string argument contains
261263 null bytes. (Weilin Du)
262264 . proc_open() now raises a ValueError when the $cwd argument contains
Original file line number Diff line number Diff line change @@ -153,6 +153,8 @@ PHP 8.6 UPGRADE NOTES
153153 contains null bytes.
154154 . dl() now raises a ValueError when the $extension_filename argument
155155 contains null bytes.
156+ . openlog() now raises a ValueError when the $prefix argument contains
157+ null bytes.
156158 . parse_str() now raises a ValueError when the $string argument contains
157159 null bytes.
158160 . linkinfo() now raises a ValueError when the $path argument is empty.
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ PHP_FUNCTION(openlog)
6161 size_t ident_len ;
6262
6363 ZEND_PARSE_PARAMETERS_START (3 , 3 )
64- Z_PARAM_STRING (ident , ident_len )
64+ Z_PARAM_PATH (ident , ident_len )
6565 Z_PARAM_LONG (option )
6666 Z_PARAM_LONG (facility )
6767 ZEND_PARSE_PARAMETERS_END ();
Original file line number Diff line number Diff line change 1+ --TEST--
2+ openlog() rejects null bytes in prefix
3+ --SKIPIF--
4+ <?php
5+ if (!function_exists ("openlog " )) die ("skip openlog() is not available " );
6+ ?>
7+ --FILE--
8+ <?php
9+ try {
10+ openlog ("foo \0bar " , LOG_NDELAY , LOG_USER );
11+ } catch (ValueError $ e ) {
12+ echo $ e ->getMessage (), "\n" ;
13+ }
14+ ?>
15+ --EXPECT--
16+ openlog(): Argument #1 ($prefix) must not contain any null bytes
You can’t perform that action at this time.
0 commit comments