From cd5d1ceadfb64e135cfa0eee7dcaad2fe56aff9f Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Wed, 24 Aug 2011 20:18:47 +0200 Subject: [PATCH] fixed bug #34112 Odd check in pbuf_alloced_custom (typo) --- CHANGELOG | 3 +++ src/core/pbuf.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index da015a13..4c35cba8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -41,6 +41,9 @@ HISTORY ++ Bugfixes: + 2011-08-24: Simon Goldschmidt + * pbuf.c: fixed bug #34112 Odd check in pbuf_alloced_custom (typo) + 2011-08-24: Simon Goldschmidt * dhcp.c: fixed bug #34122 dhcp: hostname can overflow diff --git a/src/core/pbuf.c b/src/core/pbuf.c index 6c45dbf2..cb79a987 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -391,7 +391,7 @@ pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type, struct pbuf_cust return NULL; } - if (LWIP_MEM_ALIGN_SIZE(offset) + length < payload_mem_len) { + if (LWIP_MEM_ALIGN_SIZE(offset) + length > payload_mem_len) { LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_WARNING, ("pbuf_alloced_custom(length=%"U16_F") buffer too short\n", length)); return NULL; }