From a749be9ff374aafc1ddb04cfc9f616c186dc60e7 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sun, 6 Jun 2004 04:51:41 +0000 Subject: [PATCH] uninitialized-variable-20040605 cm_dns.c: getAFSServers() did not initialize the output parameters before testing them when setting the return value. It therefore returned success when the network was unavailable. Bad Bad Bad. --- src/WINNT/afsd/cm_dns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/WINNT/afsd/cm_dns.c b/src/WINNT/afsd/cm_dns.c index 14fa4269b..81a3962ba 100644 --- a/src/WINNT/afsd/cm_dns.c +++ b/src/WINNT/afsd/cm_dns.c @@ -698,14 +698,14 @@ int getAFSServer(char *cellName, int *cellHostAddrs, char cellHostNames[][MAXHOS DWORD i; struct sockaddr_in vlSockAddr; + *numServers = 0; + *ttl = 0; + /* query the AFSDB records of cell */ if (DnsQuery_A(cellName, DNS_TYPE_AFSDB, DNS_QUERY_STANDARD, NULL, &pDnsCell, NULL) == ERROR_SUCCESS) { memset((void*) &vlSockAddr, 0, sizeof(vlSockAddr)); - *numServers = 0; - *ttl = 0; - /* go through the returned records */ for (pDnsIter = pDnsCell;pDnsIter; pDnsIter = pDnsIter->pNext) { /* if we find an AFSDB record with Preference set to 1, we found a volserver */ -- 2.39.5