diff options
author | Marc Aurele La France <tsi@ualberta.ca> | 2009-09-10 09:52:11 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-09-10 09:52:11 -0700 |
commit | 7c00227f00a83345035c4c0a6716b46864f2da8d (patch) | |
tree | be90aa1d3316326ae1e2256f87ff513e7815119f | |
parent | 5fb653029529d8cc30dbeb498f7f6d152d17ce17 (diff) | |
download | samba-7c00227f00a83345035c4c0a6716b46864f2da8d.tar.gz samba-7c00227f00a83345035c4c0a6716b46864f2da8d.tar.bz2 samba-7c00227f00a83345035c4c0a6716b46864f2da8d.zip |
Fix bug 6707 - 3.4.1 segfault in parsing configs.
Fixes an occasional segfault caused by an out-of-bounds reference in config file parsing.
-rw-r--r-- | source3/lib/interfaces.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/lib/interfaces.c b/source3/lib/interfaces.c index bc6c991f6f..b4b380000a 100644 --- a/source3/lib/interfaces.c +++ b/source3/lib/interfaces.c @@ -156,10 +156,6 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces) /* Loop through interfaces, looking for given IP address */ for (ifptr = iflist; ifptr != NULL; ifptr = ifptr->ifa_next) { - memset(&ifaces[total], '\0', sizeof(ifaces[total])); - - copy_size = sizeof(struct sockaddr_in); - if (!ifptr->ifa_addr || !ifptr->ifa_netmask) { continue; } @@ -169,6 +165,10 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces) continue; } + memset(&ifaces[total], '\0', sizeof(ifaces[total])); + + copy_size = sizeof(struct sockaddr_in); + ifaces[total].flags = ifptr->ifa_flags; #if defined(HAVE_IPV6) |