https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202142
Bug ID: 202142 Summary: Uninitialized variable usage in error path in _dns_getaddrinfo() Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: misc Assignee: freebsd-bugs@FreeBSD.org Reporter: se...@cosemica.com The calls to RES_SET_H_ERRNO() macro on error paths wind up dereferencing an uninitialized res: Index: net/getaddrinfo.c =================================================================== --- net/getaddrinfo.c (revision 286381) +++ net/getaddrinfo.c (working copy) @@ -2154,6 +2154,8 @@ memset(&sentinel, 0, sizeof(sentinel)); cur = &sentinel; + res = __res_state(); + buf = malloc(sizeof(*buf)); if (!buf) { RES_SET_H_ERRNO(res, NETDB_INTERNAL); @@ -2200,7 +2202,6 @@ return NS_UNAVAIL; } - res = __res_state(); if ((res->options & RES_INIT) == 0 && res_ninit(res) == -1) { RES_SET_H_ERRNO(res, NETDB_INTERNAL); free(buf); -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"