Skip to content

Fix uninitialized memory in network.c #15068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions main/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
#if HAVE_IPV6 && HAVE_INET_PTON
struct sockaddr_in6 in6;
#endif
} local_address;
} local_address = {0};
int local_address_len = 0;

if (sa->sa_family == AF_INET) {
Expand All @@ -873,7 +873,6 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
local_address_len = sizeof(struct sockaddr_in);
local_address.in4.sin_family = sa->sa_family;
local_address.in4.sin_port = htons(bindport);
memset(&(local_address.in4.sin_zero), 0, sizeof(local_address.in4.sin_zero));
}
}
#if HAVE_IPV6 && HAVE_INET_PTON
Expand Down
Loading