[Slirp] [Git][slirp/libslirp][master] 2 commits: tcpx_listen: Pass sizeof(addr) to memset
Samuel Thibault
gitlab at gitlab.freedesktop.org
Thu Feb 11 20:57:49 UTC 2021
Samuel Thibault pushed to branch master at slirp / libslirp
Commits:
9c2b4714 by Doug Evans at 2021-02-11T12:47:10-08:00
tcpx_listen: Pass sizeof(addr) to memset
Signed-off-by: Doug Evans <dje at google.com>
- - - - -
5aa333e7 by Samuel Thibault at 2021-02-11T20:57:48+00:00
Merge branch 'memset-sizeof' into 'master'
tcpx_listen: Pass sizeof(addr) to memset
See merge request slirp/libslirp!65
- - - - -
1 changed file:
- src/socket.c
Changes:
=====================================
src/socket.c
=====================================
@@ -744,7 +744,7 @@ static struct socket *tcpx_listen(Slirp *slirp, int family,
union slirp_sockaddr addr;
struct socket *so;
int s, opt = 1;
- socklen_t addrlen = sizeof(addr);
+ socklen_t addrlen;
DEBUG_CALL("tcpx_listen");
/* AF_INET6 addresses are bigger than AF_INET, so this is big enough. */
@@ -786,7 +786,7 @@ static struct socket *tcpx_listen(Slirp *slirp, int family,
so->so_lport6 = lport;
}
- memset(&addr, 0, addrlen);
+ memset(&addr, 0, sizeof(addr));
if (family == AF_INET) {
addr.sin.sin_family = family;
addr.sin.sin_addr = haddr.addr4;
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/compare/89d82f69458f8c54a3b67a97ee8cd66fce14bf18...5aa333e79b9892af9bf9621435d52cd058544d18
--
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/compare/89d82f69458f8c54a3b67a97ee8cd66fce14bf18...5aa333e79b9892af9bf9621435d52cd058544d18
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/slirp/attachments/20210211/6b4ce66b/attachment-0001.htm>
More information about the Slirp
mailing list