Skip to content

Commit 90002f1

Browse files
committed
Fix GH-13603 ext/sockets: properly initialised address info data.
Led to random characters visible on socket id on macOs.
1 parent 33967ae commit 90002f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/sockets/sockets.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ PHP_FUNCTION(socket_read)
917917
PHP_FUNCTION(socket_getsockname)
918918
{
919919
zval *arg1, *addr, *port = NULL;
920-
php_sockaddr_storage sa_storage;
920+
php_sockaddr_storage sa_storage = {0};
921921
php_socket *php_sock;
922922
struct sockaddr *sa;
923923
struct sockaddr_in *sin;
@@ -994,7 +994,7 @@ PHP_FUNCTION(socket_getsockname)
994994
PHP_FUNCTION(socket_getpeername)
995995
{
996996
zval *arg1, *arg2, *arg3 = NULL;
997-
php_sockaddr_storage sa_storage;
997+
php_sockaddr_storage sa_storage = {0};
998998
php_socket *php_sock;
999999
struct sockaddr *sa;
10001000
struct sockaddr_in *sin;

0 commit comments

Comments
 (0)