1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

fixe remote panic on short packet

Obtained from: KAME
This commit is contained in:
SUZUKI Shinsuke 2003-10-31 03:18:45 +00:00
parent aaaad65dcd
commit 7a1413f972
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121779

View File

@ -1126,6 +1126,11 @@ riprecv()
if (idx && IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr))
SET_IN6_LINKLOCAL_IFINDEX(fsock.sin6_addr, idx);
if (len < sizeof(struct rip6)) {
trace(1, "Packet too short\n");
return;
}
nh = fsock.sin6_addr;
nn = (len - sizeof(struct rip6) + sizeof(struct netinfo6)) /
sizeof(struct netinfo6);