From 22bcf5892acd39d66902b4dd711bcd05bef0f2eb Mon Sep 17 00:00:00 2001 From: goldsimon Date: Mon, 27 Jul 2009 15:17:13 +0000 Subject: [PATCH] Fixed bug #27034: "Invalid ASSERT in pbuf_alloc()" to prevent breaking PPP (for now). --- src/core/pbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/pbuf.c b/src/core/pbuf.c index 55a0bf01..50b22c35 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -200,7 +200,8 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type) LWIP_ASSERT("check p->payload + p->len does not overflow pbuf", ((u8_t*)p->payload + p->len <= (u8_t*)p + SIZEOF_STRUCT_PBUF + PBUF_POOL_BUFSIZE_ALIGNED)); - LWIP_ASSERT("PBUF_POOL_BUFSIZE must be bigger than MEM_ALIGNMENT", p->len != 0); + LWIP_ASSERT("PBUF_POOL_BUFSIZE must be bigger than MEM_ALIGNMENT", + (PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset)) > 0 ); /* set reference count (needed here in case we fail) */ p->ref = 1;