avoid heap overrun

Obtained from: KAME
MFC after: 1 day
This commit is contained in:
suz 2006-03-23 14:39:38 +00:00
parent ec17f77885
commit 20b21e2a36

View File

@ -656,7 +656,7 @@ get_prefix(struct rainfo *rai)
memcpy(&pp->prefix, a, sizeof(*a));
p = (u_char *)&pp->prefix;
ep = (u_char *)(&pp->prefix + 1);
while (m < lim)
while (m < lim && p < ep)
*p++ &= *m++;
while (p < ep)
*p++ = 0x00;