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

Submitted by:  Ivan Delamer <idelamer>
Submitted on:  Wed 11 Jan 2012 07:28:56 PM UTC  
 
Category: pbufsSeverity: 3 - Normal
Item Group: Crash ErrorStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned 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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 20 Jan 2012 08:21:50 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed
    Fri 20 Jan 2012 06:38:10 AM UTCgoldsimonPlanned Release=>1.4.1

    Back to the top


    Powered by Savane 3.1-cleanup1