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/21885] New: getaddrinfo: gethosts does not release resolver context on memory allocation failure


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

            Bug ID: 21885
           Summary: getaddrinfo: gethosts does not release resolver
                    context on memory allocation failure
           Product: glibc
           Version: 2.26
            Status: NEW
          Severity: normal
          Priority: P2
         Component: network
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---
             Flags: security-

This is a pre-existing bug but arguably made worse by the resolver context
extension:

    if (!scratch_buffer_grow (tmpbuf))                                        \
      {                                                                       \
        result = -EAI_MEMORY;                                                 \
        goto free_and_return;                                                 \
      }                                                                       \

vs

      if (herrno == NETDB_INTERNAL)                                           \
        {                                                                     \
          __set_h_errno (herrno);                                             \
          __resolv_context_enable_inet6 (res_ctx, res_enable_inet6);          \
          __resolv_context_put (res_ctx);                                     \
          result = -EAI_SYSTEM;                                               \
          goto free_and_return;                                               \
        }                                                                     \

The first error return path needs to call __resolv_context_* functions as well.

-- 
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]