mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 03:16:18 +00:00
ip6_reass: don't crash if frag header isn't the first (or not in the first pbuf)
This commit is contained in:
parent
d98e25a783
commit
fda778f6b6
@ -268,8 +268,12 @@ ip6_reass(struct pbuf *p)
|
||||
|
||||
IP6_FRAG_STATS_INC(ip6_frag.recv);
|
||||
|
||||
LWIP_ASSERT("ip6_frag_hdr must be in the first pbuf, not chained",
|
||||
(const void*)ip6_current_header() == ((u8_t*)p->payload) - IP6_HLEN);
|
||||
if ((const void*)ip6_current_header() != ((u8_t*)p->payload) - IP6_HLEN) {
|
||||
/* ip6_frag_hdr must be in the first pbuf, not chained */
|
||||
IP6_FRAG_STATS_INC(ip6_frag.proterr);
|
||||
IP6_FRAG_STATS_INC(ip6_frag.drop);
|
||||
goto nullreturn;
|
||||
}
|
||||
|
||||
frag_hdr = (struct ip6_frag_hdr *) p->payload;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user