Skip to content

Commit 40e0e92

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix uninitialized memory in network.c
2 parents 4377dff + 40551dd commit 40e0e92

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ PHP NEWS
88
. Fixed bug GH-15023 (Memory leak in Zend/zend_ini.c). (nielsdos)
99
. Fixed bug GH-13330 (Append -Wno-implicit-fallthrough flag conditionally).
1010
(Peter Kokot)
11+
. Fix uninitialized memory in network.c. (nielsdos)
1112

1213
- Curl:
1314
. Fixed case when curl_error returns an empty string.

main/network.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
861861
#if HAVE_IPV6 && HAVE_INET_PTON
862862
struct sockaddr_in6 in6;
863863
#endif
864-
} local_address;
864+
} local_address = {0};
865865
int local_address_len = 0;
866866

867867
if (sa->sa_family == AF_INET) {
@@ -873,7 +873,6 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
873873
local_address_len = sizeof(struct sockaddr_in);
874874
local_address.in4.sin_family = sa->sa_family;
875875
local_address.in4.sin_port = htons(bindport);
876-
memset(&(local_address.in4.sin_zero), 0, sizeof(local_address.in4.sin_zero));
877876
}
878877
}
879878
#if HAVE_IPV6 && HAVE_INET_PTON

0 commit comments

Comments
 (0)