[Bug 202142] Uninitialized variable usage in error path in _dns_getaddrinfo()
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Thu Aug 6 19:36:45 UTC 2015
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 at FreeBSD.org
Reporter: seanb at 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.
More information about the freebsd-bugs
mailing list