diff options
author | jperkin <jperkin@pkgsrc.org> | 2014-03-14 09:45:31 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2014-03-14 09:45:31 +0000 |
commit | 2a79e209d9913a5c10a69ba2196a59a45d1c81ce (patch) | |
tree | 0fd5ecf69f672dbf793d0d0ad02a56a808fa9b69 /pkgtools/pbulk | |
parent | 277d58a3d4c2a997fd4a392b983e94182f118efd (diff) | |
download | pkgsrc-2a79e209d9913a5c10a69ba2196a59a45d1c81ce.tar.gz |
pbulk-base-0.48: Fix pbulk-scan on OSX.
On OSX pbulk-scan can fail to bind with EADDRNOTAVAIL due to sin_zero being
used uninitialised. Ensure the sockaddr_in is cleared before use.
Diffstat (limited to 'pkgtools/pbulk')
-rw-r--r-- | pkgtools/pbulk/files/pbulk/lib/netaddr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgtools/pbulk/files/pbulk/lib/netaddr.c b/pkgtools/pbulk/files/pbulk/lib/netaddr.c index 52989b78530..fbe45f5d021 100644 --- a/pkgtools/pbulk/files/pbulk/lib/netaddr.c +++ b/pkgtools/pbulk/files/pbulk/lib/netaddr.c @@ -1,4 +1,4 @@ -/* $NetBSD: netaddr.c,v 1.7 2008/02/21 14:40:43 tnn Exp $ */ +/* $NetBSD: netaddr.c,v 1.8 2014/03/14 09:45:31 jperkin Exp $ */ /*- * Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>. @@ -68,6 +68,7 @@ parse_sockaddr_in(const char *str, struct sockaddr_in *addr) tmp = strtoul(str, &port_end, 10); if (*str == '\0' || *port_end != '\0' || errno != 0 || tmp > 0xfffful) return -1; + memset(addr, 0, sizeof(struct sockaddr_in)); addr->sin_port = htons((in_port_t)tmp); addr->sin_addr = in; #if !defined(__sun) && !defined(__hpux) && !defined(__INTERIX) && \ |