File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ PHP_FUNCTION(gethostbyaddr)
147
147
zend_string * hostname ;
148
148
149
149
ZEND_PARSE_PARAMETERS_START (1 , 1 )
150
- Z_PARAM_STRING (addr , addr_len )
150
+ Z_PARAM_PATH (addr , addr_len )
151
151
ZEND_PARSE_PARAMETERS_END ();
152
152
153
153
hostname = php_gethostbyaddr (addr );
@@ -207,7 +207,7 @@ PHP_FUNCTION(gethostbyname)
207
207
size_t hostname_len ;
208
208
209
209
ZEND_PARSE_PARAMETERS_START (1 , 1 )
210
- Z_PARAM_STRING (hostname , hostname_len )
210
+ Z_PARAM_PATH (hostname , hostname_len )
211
211
ZEND_PARSE_PARAMETERS_END ();
212
212
213
213
if (hostname_len > MAXFQDNLEN ) {
@@ -230,7 +230,7 @@ PHP_FUNCTION(gethostbynamel)
230
230
int i ;
231
231
232
232
ZEND_PARSE_PARAMETERS_START (1 , 1 )
233
- Z_PARAM_STRING (hostname , hostname_len )
233
+ Z_PARAM_PATH (hostname , hostname_len )
234
234
ZEND_PARSE_PARAMETERS_END ();
235
235
236
236
if (hostname_len > MAXFQDNLEN ) {
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #76755 (setcookie does not accept "double" type for expire time)
3
+ --FILE--
4
+ <?php
5
+ $ host = "localhost \0.example.com " ;
6
+ try {
7
+ var_dump (gethostbyname ($ host ));
8
+ } catch (Error $ e ) {
9
+ print $ e ->getMessage ()."\n" ;
10
+ }
11
+ try {
12
+ var_dump (gethostbynamel ($ host ));
13
+ } catch (Error $ e ) {
14
+ print $ e ->getMessage ()."\n" ;
15
+ }
16
+ ?>
17
+ --EXPECT--
18
+ gethostbyname(): Argument #1 ($hostname) must not contain any null bytes
19
+ gethostbynamel(): Argument #1 ($hostname) must not contain any null bytes
You can’t perform that action at this time.
0 commit comments