diff options
author | kevlo <kevlo@FreeBSD.org> | 2012-09-07 08:58:30 +0000 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2012-09-07 08:58:30 +0000 |
commit | 31557286d9e74dc6e63fb5ac54ce7295e60855f3 (patch) | |
tree | c9db87d873d820a5e6b541ba4128b69f67b8de4e /contrib/bsnmp/snmpd | |
parent | 9db084a6c31249cf4aa6f0a64ba1e8d94b4f4dd5 (diff) | |
download | FreeBSD-src-31557286d9e74dc6e63fb5ac54ce7295e60855f3.zip FreeBSD-src-31557286d9e74dc6e63fb5ac54ce7295e60855f3.tar.gz |
Fully initialize the stack-allocated "struct sockaddr_in sa" structure.
Diffstat (limited to 'contrib/bsnmp/snmpd')
-rw-r--r-- | contrib/bsnmp/snmpd/trap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/bsnmp/snmpd/trap.c b/contrib/bsnmp/snmpd/trap.c index d13f902..bf02708 100644 --- a/contrib/bsnmp/snmpd/trap.c +++ b/contrib/bsnmp/snmpd/trap.c @@ -117,7 +117,7 @@ trapsink_create(struct trapsink_dep *tdep) return (SNMP_ERR_RES_UNAVAIL); } (void)shutdown(t->socket, SHUT_RD); - + memset(&sa, 0, sizeof(sa)); sa.sin_len = sizeof(sa); sa.sin_family = AF_INET; sa.sin_addr.s_addr = htonl((t->index.subs[0] << 24) | @@ -725,6 +725,7 @@ target_activate_address(struct target_address *addrs) } (void)shutdown(addrs->socket, SHUT_RD); + memset(&sa, 0, sizeof(sa)); sa.sin_len = sizeof(sa); sa.sin_family = AF_INET; |