diff options
Diffstat (limited to 'usr.sbin/route6d/route6d.c')
-rw-r--r-- | usr.sbin/route6d/route6d.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c index 0622918..b19b799 100644 --- a/usr.sbin/route6d/route6d.c +++ b/usr.sbin/route6d/route6d.c @@ -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); |