From 60952803044e098682c150b7ed91d4da87f5bb79 Mon Sep 17 00:00:00 2001 From: "Gerald (Jerry) Carter" Date: Fri, 19 Oct 2007 14:36:34 -0500 Subject: Fix a crash in resolve_hosts() caused by an out-of-bounds array reference. (This used to be commit bafcede2c29813f8719fc3b54f94612e72c48043) --- source3/libsmb/namequery.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 12e0d01b3b..6585fd751c 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -1074,7 +1074,6 @@ static NTSTATUS resolve_hosts(const char *name, int name_type, &((struct sockaddr_in *)res->ai_addr)->sin_addr); *return_count += 1; - i++; *return_iplist = SMB_REALLOC_ARRAY(*return_iplist, struct ip_service, @@ -1086,6 +1085,8 @@ static NTSTATUS resolve_hosts(const char *name, int name_type, } (*return_iplist)[i].ip = return_ip; (*return_iplist)[i].port = PORT_NONE; + + i++; } if (ailist) { freeaddrinfo(ailist); -- cgit