PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Valgrind Report for ext/standard/tests/streams/bug74090.phpt ('Bug #74090 stream_get_contents maxlength>-1 returns empty string on windows')

Script

1: <?php
2: $port 
12327;
3:
$server false;
4: while(!
$server && $port 20000){
5:     
$port++;
6:     
$server stream_socket_server("udp://localhost:$port"$errno$errstrSTREAM_SERVER_BIND);
7: }
8: if(!
$server){
9:     
var_dump(false);
10:     die(
"Cannot create server socket");
11: }
12:
$data base64_decode("1oIBAAABAAAAAAAAB2V4YW1wbGUDb3JnAAABAAE=");
13:
$fd stream_socket_client("udp://localhost:$port"$errno$errstr0STREAM_CLIENT_CONNECT STREAM_CLIENT_ASYNC_CONNECT);
14:
stream_set_blocking($fd0);
15:
stream_socket_sendto($fd$data);
16:
stream_socket_recvfrom($server10$peer);
17:
stream_socket_sendto($server$data0$peer);
18:
$ret stream_get_contents($fd65565);
19:
var_dump(strlen($ret) > 0);
20:
stream_socket_shutdown($fdSTREAM_SHUT_RDWR);
21:
stream_socket_shutdown($serverSTREAM_SHUT_RDWR);
22:
?>
23:
==DONE==
24:

Report

==26105== Syscall param socketcall.sendto(to.sin6_scope_id) points to uninitialised byte(s)
==26105==    at 0x804FE63: __sendto_nocancel (in /lib64/libpthread-2.12.so)
==26105==    by 0xE6583A: sock_sendto (xp_socket.c:251)
==26105==    by 0xE6613B: php_sockop_set_option (xp_socket.c:392)
==26105==    by 0xE67E82: php_tcp_sockop_set_option (xp_socket.c:872)
==26105==    by 0xE498E9: _php_stream_set_option (streams.c:1321)
==26105==    by 0xE6468E: php_stream_xport_sendto (transports.c:488)
==26105==    by 0xD54866: zif_stream_socket_sendto (streamsfuncs.c:357)
==26105==    by 0x116E2D2: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:912)
==26105==    by 0x116E2D2: execute_ex (zend_vm_execute.h:60369)
==26105==    by 0x1197C83: zend_execute (zend_vm_execute.h:66602)
==26105==    by 0xF27316: zend_execute_scripts (zend.c:1629)
==26105==    by 0xE15279: php_execute_script (main.c:2650)
==26105==    by 0x119DB6F: do_cli (php_cli.c:985)
==26105==  Address 0x1ffeff8d78 is on thread 1's stack
==26105==  in frame #6, created by zif_stream_socket_sendto (streamsfuncs.c:331)
==26105== 

 

Generated at Mon, 06 May 2019 17:58:35 +0000 (295 days ago)

Copyright © 2005-2020 The PHP Group
All rights reserved.