Skip to content

Commit 32fe9bc

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Fix uninitialized memory in network.c
2 parents 40e0d3a + 40e0e92 commit 32fe9bc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

main/network.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -842,15 +842,14 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
842842
#ifdef HAVE_IPV6
843843
struct sockaddr_in6 in6;
844844
#endif
845-
} local_address;
845+
} local_address = {0};
846846
int local_address_len = 0;
847847

848848
if (sa->sa_family == AF_INET) {
849849
if (inet_pton(AF_INET, bindto, &local_address.in4.sin_addr) == 1) {
850850
local_address_len = sizeof(struct sockaddr_in);
851851
local_address.in4.sin_family = sa->sa_family;
852852
local_address.in4.sin_port = htons(bindport);
853-
memset(&(local_address.in4.sin_zero), 0, sizeof(local_address.in4.sin_zero));
854853
}
855854
}
856855
#ifdef HAVE_IPV6

0 commit comments

Comments
 (0)