lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] Invalid check in pbuf_alloced_custom


From: Mikael Vidstedt
Subject: [lwip-devel] Invalid check in pbuf_alloced_custom
Date: Mon, 23 May 2011 22:03:28 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; sv-SE; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10


Hi,

I believe the length check in pbuf_alloced_custom is backwards, suggest the following change.

Cheers,
Mikael

--- pbuf.c    2011-05-23 21:35:10.994550358 +0200
+++ pbuf.c.new    2011-05-23 21:35:52.204549162 +0200
@@ -369,7 +369,7 @@
     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;
   }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]