diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-06-12 12:26:38 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-06-12 12:26:38 +0200 |
commit | dcecde136a0c5e67c7caf3de9827e32737c75f90 (patch) | |
tree | a3b48404b5f33bbe1ca8a261467e5557d9d01a89 /stun.c | |
parent | 9c6dbdeecc620e1c3013914bf1bc8384be5b2a8b (diff) |
stun: memset saddr before binding
We need to zero out data before we actually do the bind, otherwise
uninitialized crap can be in saddr.
Found by coverty scanner.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'stun.c')
-rw-r--r-- | stun.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -33,7 +33,7 @@ struct stun_header { uint16_t type; uint16_t len; - uint32_t magic_cookie; + uint32_t magic_cookie; uint32_t transid[3]; }; @@ -74,6 +74,7 @@ static int stun_test(const char *server_ip, int server_port, set_reuseaddr(sock); + memset(&saddr, 0, sizeof(saddr)); saddr.sin_family = PF_INET; saddr.sin_port = htons(tun_port); saddr.sin_addr.s_addr = INADDR_ANY; |