summaryrefslogtreecommitdiff
path: root/slirp/src
diff options
context:
space:
mode:
Diffstat (limited to 'slirp/src')
-rw-r--r--slirp/src/ip6_input.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/slirp/src/ip6_input.c b/slirp/src/ip6_input.c
index dfcbfd6a7..d88d1ab92 100644
--- a/slirp/src/ip6_input.c
+++ b/slirp/src/ip6_input.c
@@ -49,6 +49,13 @@ void ip6_input(struct mbuf *m)
goto bad;
}
+ // Check if the message size is big enough to hold what's
+ // set in the payload length header. If not this is an invalid
+ // packet
+ if (m->m_len < ntohs(ip6->ip_pl) + sizeof(struct ip6)) {
+ goto bad;
+ }
+
/* check ip_ttl for a correct ICMP reply */
if (ip6->ip_hl == 0) {
icmp6_send_error(m, ICMP6_TIMXCEED, ICMP6_TIMXCEED_INTRANS);