]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Bug #690: Fix length returned. Prevents buffer overflow
authorDanny Mayer <mayer@ntp.org>
Fri, 25 Aug 2006 13:00:40 +0000 (09:00 -0400)
committerDanny Mayer <mayer@ntp.org>
Fri, 25 Aug 2006 13:00:40 +0000 (09:00 -0400)
bk: 44eef478gqcYv-d2I7bVamhQpZhatg

ports/winnt/libntp/dnslookup.c

index b304b775e4fb01ce47d6b4993a2138972ddb9838..20fb52cdbd26daf8c4523ccb169adb6944297684 100644 (file)
@@ -163,7 +163,7 @@ DNSlookup_name(
                                addr = (struct hostent *) malloc(sizeof(struct hostent));
                                memset(addr, 0, sizeof(struct hostent));
                                addr->h_addrtype = (short) results->lpcsaBuffer->iSocketType;
-                               addr->h_length = (short) results->lpcsaBuffer->RemoteAddr.iSockaddrLength;
+                               addr->h_length = sizeof(struct in_addr); /* Only passing back the address */
                        }
                        for (i = 0; i < results->dwNumberOfCsAddrs; i++)
                        {