summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMarc Aurele La France <tsi@ualberta.ca>2009-09-10 09:52:11 -0700
committerJeremy Allison <jra@samba.org>2009-09-10 09:52:11 -0700
commit7c00227f00a83345035c4c0a6716b46864f2da8d (patch)
treebe90aa1d3316326ae1e2256f87ff513e7815119f /source3
parent5fb653029529d8cc30dbeb498f7f6d152d17ce17 (diff)
downloadsamba-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.
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/interfaces.c8
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)