buglwIP - A Lightweight TCP/IP stack - Bugs: bug #35291, NULL pointer in pbuf_copy

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #35291: NULL pointer in pbuf_copy

Submitter:  Ivan Delamer <idelamer>
Submitted:  Wed 11 Jan 2012 07:28:56 PM UTC
   
 
Category:  pbufs Severity:  3 - Normal
Item Group:  Crash Error Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  CVS Head

Fri 20 Jan 2012 08:21:50 PM UTC, comment #2: 

Fixed, but it would still be interesting to know why this happened.

Simon Goldschmidt <goldsimon>
Group administrator
Fri 20 Jan 2012 06:38:10 AM UTC, comment #1: 

Seems like an invalid pbuf being passed in but still no reason to fail hard. I'll fix this for 1.4.1.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 11 Jan 2012 07:28:56 PM UTC, original submission:  

I'm still investigating this,but I've come across some cases where we try to MEMCPY to a NULL pbuf in pbuf_copy.

Looks like p_to is advanced to p_to->next, which is NULL, but somehow p_from is not yet NULL and we try to copy data.

At the moment, there is just a p_to != NULL ASSERTion. I suggest either changing the assert to a LWIP_ERROR, or change the loop condition to while (p_from && p_to)

In my analysis, the call is coming from etharp_query queing a packet. Must be some kind of malformed pbuf p_from to cause this error, and I can't find the source yet. But it seems like this change to pbuf_copy could be a good idea.

Ivan Delamer <idelamer>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by idelamer (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-01-20 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2012-01-20 goldsimon Planned Release 1.4.1

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code