This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug network/19994] New: getaddrinfo does not restore RES_USE_INET6 flag in gethosts


https://sourceware.org/bugzilla/show_bug.cgi?id=19994

            Bug ID: 19994
           Summary: getaddrinfo does not restore RES_USE_INET6 flag in
                    gethosts
           Product: glibc
           Version: 2.24
            Status: NEW
          Severity: normal
          Priority: P3
         Component: network
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---
             Flags: security-

getaddrinfo clears the RES_USE_INET6 flag.

          /* If we are looking for both IPv4 and IPv6 address we don't
             want the lookup functions to automatically promote IPv4
             addresses to IPv6 addresses.  Currently this is decided
             by setting the RES_USE_INET6 bit in _res.options.  */
          old_res_options = _res.options;
          _res.options &= ~RES_USE_INET6;

However, in case of a memory allocation failure in the gethosts macro,
_res.options is not restored prior to the jump to the free_and_return label.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]