]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix crash in nicinfo/nicInfoPosix.c:PrintResolverNSInfo
authorOliver Kurth <okurth@vmware.com>
Fri, 2 Aug 2019 18:07:21 +0000 (11:07 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 2 Aug 2019 18:07:21 +0000 (11:07 -0700)
SIGSEGV trying to access resp->_u._ext.nsaddrs[i]->sin6_family in
PrintResolverNSInfo.

Fix: zero out the struct __res_state memory before calling res_ninit().

open-vm-tools/lib/nicInfo/nicInfoPosix.c

index 3fa91053fc0f64b4785bcec0fbeb9acf95aa2f70..e661993b387bcb402f7358c5a66cfd6ff4a51133 100644 (file)
@@ -838,6 +838,7 @@ RecordResolverInfo(NicInfoV3 *nicInfo)  // OUT
    char **s;
    struct __res_state res;
 
+   memset(&res, 0, sizeof res);
    if (res_ninit(&res) == -1) {
       g_warning("%s: Resolver res_init failed.\n", __FUNCTION__);
       return FALSE;