From 8c9542220413ce5cdc761759839275715b87ab01 Mon Sep 17 00:00:00 2001 From: Ivan Delamer Date: Fri, 2 Mar 2012 09:18:54 -0700 Subject: [PATCH] Early exit when checking if ip6 reassembled packet is valid. --- src/core/ipv6/ip6_frag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ipv6/ip6_frag.c b/src/core/ipv6/ip6_frag.c index 1e6304ee..a43fd614 100644 --- a/src/core/ipv6/ip6_frag.c +++ b/src/core/ipv6/ip6_frag.c @@ -443,7 +443,7 @@ ip6_reass(struct pbuf *p) /* Final validity test: no gaps between current and last fragment. */ iprh_prev = iprh; q = iprh->next_pbuf; - while (q != NULL) { + while ((q != NULL) && valid) { iprh = (struct ip6_reass_helper*)q->payload; if (iprh_prev->end != iprh->start) { valid = 0;