This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug network/15698] New: Memory overrun in getifaddrs_internal
- From: "hjl.tools at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 27 Jun 2013 21:04:08 +0000
- Subject: [Bug network/15698] New: Memory overrun in getifaddrs_internal
- Auto-submitted: auto-generated
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.