From c18abd4fbe25ea0375c66696811c265af85352a3 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Mon, 19 May 2014 22:07:57 +0200 Subject: [PATCH] Fixed bug #41686 (ipv4 ip_reass() crash error) introduced some months ago while fixing bug #41041... --- src/core/ipv4/ip_frag.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/ipv4/ip_frag.c b/src/core/ipv4/ip_frag.c index 86901156..1b84c982 100644 --- a/src/core/ipv4/ip_frag.c +++ b/src/core/ipv4/ip_frag.c @@ -595,9 +595,13 @@ ip_reass(struct pbuf *p) } /* find the previous entry in the linked list */ - for (ipr_prev = reassdatagrams; ipr_prev != NULL; ipr_prev = ipr_prev->next) { - if (ipr_prev->next == ipr) { - break; + if (ipr == reassdatagrams_ipv4) { + ipr_prev = NULL; + } else { + for (ipr_prev = reassdatagrams; ipr_prev != NULL; ipr_prev = ipr_prev->next) { + if (ipr_prev->next == ipr) { + break; + } } }