From 64aa4c716d794d0c6cb89cee2ecc2167016533f9 Mon Sep 17 00:00:00 2001 From: kieranm Date: Wed, 24 Nov 2004 17:03:03 +0000 Subject: [PATCH] Kieran Mansley - kjm25@cam.ac.uk - 24th Nov 2004 * Increased argument checking at start of pbuf_queue() and made resulting errors more verbose --- src/core/pbuf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/pbuf.c b/src/core/pbuf.c index f2230cfe..cefab54e 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -723,9 +723,13 @@ pbuf_queue(struct pbuf *p, struct pbuf *n) struct pbuf *q = p; #endif /* programmer stupidity checks */ - LWIP_ASSERT("p != NULL", p != NULL); - LWIP_ASSERT("n != NULL", n != NULL); - if ((p == NULL) || (n == NULL)) return; + LWIP_ASSERT("p == NULL in pbuf_queue: this indicates a programmer error\n", p != NULL); + LWIP_ASSERT("n == NULL in pbuf_queue: this indicates a programmer error\n", n != NULL); + LWIP_ASSERT("p == n in pbuf_queue: this indicates a programmer error\n", p != n); + if ((p == NULL) || (n == NULL) || (p == n)){ + LWIP_ERRORF(PBUF_DEBUG | DBG_HALT | 3, ("pbuf_queue: programmer argument error\n")) + return; + } /* iterate through all packets on queue */ while (p->next != NULL) {