From b1487e64806b5250da568b1fabedaf310e3cc1ca Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Wed, 27 Jun 2018 20:56:05 +0200 Subject: [PATCH] ip4_reass: fixed duplicat NULL check See bug #54197 Rerported-by: Andrey Vinogradov Signed-off-by: Simon Goldschmidt --- src/core/ipv4/ip4_frag.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/ipv4/ip4_frag.c b/src/core/ipv4/ip4_frag.c index 39a6f55b..a445530e 100644 --- a/src/core/ipv4/ip4_frag.c +++ b/src/core/ipv4/ip4_frag.c @@ -677,7 +677,8 @@ ip4_reass(struct pbuf *p) return NULL; nullreturn_ipr: - if ((ipr != NULL) && (ipr->p == NULL)) { + LWIP_ASSERT("ipr != NULL", ipr != NULL); + if (ipr->p == NULL) { /* dropped pbuf after creating a new datagram entry: remove the entry, too */ LWIP_ASSERT("not firstalthough just enqueued", ipr == reassdatagrams); ip_reass_dequeue_datagram(ipr, NULL);