diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-04-15 14:59:05 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-04-15 14:59:05 +0200 |
commit | 9b1950b00591e3a6de0f39e6c1a5708d37188224 (patch) | |
tree | 65bc02e25be4bdc7c4b18864e21208b1eb4385de | |
parent | 917952453cef3df3e81a8d101de45d87b8d74f8e (diff) | |
download | php-git-9b1950b00591e3a6de0f39e6c1a5708d37188224.tar.gz |
Zero sockaddr struct
in6 has a bunch of extra fields that we're leaving uninitialized. I
don't see them locally, but there's valgrind warnings on gcov.
-rw-r--r-- | main/network.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/main/network.c b/main/network.c index 13964e34f8..70a1bc53fc 100644 --- a/main/network.c +++ b/main/network.c @@ -526,6 +526,8 @@ PHPAPI int php_network_parse_network_address_with_port(const char *addr, zend_lo struct sockaddr_in6 *in6 = (struct sockaddr_in6*)sa; #endif + memset(sa, 0, sizeof(struct sockaddr)); + if (*addr == '[') { colon = memchr(addr + 1, ']', addrlen-1); if (!colon || colon[1] != ':') { |