lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #21075] pbuf_realloc() use with PBUF_RAM and MEM_LIBC_


From: Bill Florac
Subject: [lwip-devel] [bug #21075] pbuf_realloc() use with PBUF_RAM and MEM_LIBC_MALLOC fails
Date: Fri, 14 Sep 2007 08:37:03 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

URL:
  <http://savannah.nongnu.org/bugs/?21075>

                 Summary: pbuf_realloc() use with PBUF_RAM and
MEM_LIBC_MALLOC fails
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: bflorac
            Submitted on: Friday 09/14/2007 at 08:37
                Category: pbufs
                Severity: 3 - Normal
              Item Group: Crash Error
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 

    _______________________________________________________

Details:

The pbuf_realloc() function when used with a PBUF_RAM type buffer and the
MEM_LIBC_MALLOC set to 1 can fail.  The function calls mem_realloc() which is
defined as realloc(). When calling realloc() there is no certainty that the
pointer passed will be the same one returned. In fact, the return values is
being ignored and could be null (unlikely on a shrink).

To fix the problem, the pbuf_realloc() needs to return the pointer from
mem_realloc call back the calling program. 

I can provide a patch for pbuf.c and pbuf.h but I suppose someone needs to
evaluate where pbuf_realloc is used to see if it would be a problem and put
them all in one patch.







    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?21075>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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