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/15698] New: Memory overrun in getifaddrs_internal


http://sourceware.org/bugzilla/show_bug.cgi?id=15698

            Bug ID: 15698
           Summary: Memory overrun in getifaddrs_internal
           Product: glibc
           Version: 2.18
            Status: NEW
          Severity: normal
          Priority: P2
         Component: network
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com

When the netmask length is the same as address size, getifaddrs_internal
has memory overrun in

                 if (cp != NULL)
                    {
                      char c;
                      unsigned int preflen;

                      if ((max_prefixlen > 0) &&
                          (ifam->ifa_prefixlen > max_prefixlen))
                        preflen = max_prefixlen;
                      else
                        preflen = ifam->ifa_prefixlen;

                      for (i = 0; i < (preflen / 8); i++)
                        *cp++ = 0xff;
                      c = 0xff;
                      c <<= (8 - (preflen % 8));
                      *cp = c;
                    }

It should check if preflen < max_prefixlen before updating
the last byte of netmask.

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