File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -183,9 +183,9 @@ PHP_FUNCTION(bindtextdomain)
183183 char * retval , dir_name [MAXPATHLEN ], * btd_result ;
184184
185185 ZEND_PARSE_PARAMETERS_START (1 , 2 )
186- Z_PARAM_STR (domain )
186+ Z_PARAM_PATH_STR (domain )
187187 Z_PARAM_OPTIONAL
188- Z_PARAM_STR_OR_NULL (dir )
188+ Z_PARAM_PATH_STR_OR_NULL (dir )
189189 ZEND_PARSE_PARAMETERS_END ();
190190
191191 PHP_GETTEXT_DOMAIN_LENGTH_CHECK (1 , ZSTR_LEN (domain ))
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-17400 bindtextdomain segfaults with invalid domain/domain with null bytes.
3+ --EXTENSIONS--
4+ gettext
5+ --CREDITS--
6+ YuanchengJiang
7+ --FILE--
8+ <?php
9+ $ utf16_first_le = pack ("H* " , "00d800dc " );
10+ $ utf16le_char_bad = pack ("H* " , "00dc00dc " );
11+
12+ try {
13+ bindtextdomain ($ utf16le_char_bad ,$ utf16_first_le );
14+ } catch (\ValueError $ e ) {
15+ echo $ e ->getMessage ();
16+ }
17+ ?>
18+ --EXPECT--
19+ bindtextdomain(): Argument #1 ($domain) must not contain any null bytes
You can’t perform that action at this time.
0 commit comments