From efe78e7e5b9e6c3e4916c6d3a722d16f785b2ec3 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Thu, 12 Oct 2023 21:34:11 +0200 Subject: [PATCH] pbuf_cat: add a simple check to ensure we don't cat the same pbuf to itself --- src/core/pbuf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/pbuf.c b/src/core/pbuf.c index ad3995b1..54a6e0e4 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -860,6 +860,7 @@ pbuf_cat(struct pbuf *h, struct pbuf *t) LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)", ((h != NULL) && (t != NULL)), return;); + LWIP_ASSERT("Creating an infinite loop", h != t); /* proceed to last pbuf of chain */ for (p = h; p->next != NULL; p = p->next) {