Fix bad bugfix for bug #8910 - resolve_ads() code can return zero addresses and miss...
authorIra Cooper <ira@wakeful.net>
Wed, 30 May 2012 18:50:06 +0000 (11:50 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 30 May 2012 21:29:02 +0000 (23:29 +0200)
Original code incorrectly used a while() instead of a for() loop.
We need to iterate over the entire array here.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed May 30 23:29:03 CEST 2012 on sn-devel-104

source3/libsmb/namequery.c

index 3eae3470683ec9d84b15b9dbe926720dc3e9d21e..4c05e4f4189c2540b9c6d0edfaaf69e1cb55974c 100644 (file)
@@ -2491,7 +2491,7 @@ static NTSTATUS resolve_ads(const char *name,
 
        *return_count = 0;
 
-       while ( i < numdcs && (*return_count<numaddrs) ) {
+       for (i = 0; i < numdcs && (*return_count<numaddrs); i++ ) {
                /* If we don't have an IP list for a name, lookup it up */
                if (!dcs[i].ss_s) {
                        /* We need to get all IP addresses here. */