buglwIP - A Lightweight TCP/IP stack - Bugs: bug #36645, Calling dhcp_release before...


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

bug #36645: Calling dhcp_release before dhcp_start dereferences NULL

Submitted by:  Mason <mason>
Submitted on:  Wed 13 Jun 2012 07:43:01 AM UTC  
Category:  None Severity:  3 - Normal
Item Group:  Crash Error Status:  Fixed
Privacy:  Public Assigned to:  Simon Goldschmidt <goldsimon>
Open/Closed:  Closed Planned Release:  None
lwIP version:  1.4.0

Mon 13 Aug 2012 07:52:06 PM UTC, comment #2: 

Since dhcp_restart() is part of the "public API" of that module, I very strongly suggest to not fail hard in such a case. If anything, we can add an assertion there.

For now, I've just added a NULL-check at the start of the function.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Tue 19 Jun 2012 07:14:05 PM UTC, comment #1: 

Tricky one.  How much extra code do we want to add to lwIP to make it robust to errors in the code using it?  One could argue that by leaving it as it is, the error in the code calling it is much more likely to get fixed.

Kieran Mansley <kieranm>
Project Member
Wed 13 Jun 2012 07:43:01 AM UTC, original submission:  

I suppose this should be considered a programming error, but
I'm not sure it should bring the system down.

Calling dhcp_release when dhcp_start has never been called
causes a NULL dereference (because the dhcp struct has never
been allocated).

dhcp_release calls dhcp_set_state(dhcp, DHCP_OFF);
dhcp_state( ) reads dhcp->state.
If dhcp is NULL : bam.

Mason <mason>


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 kieranm (Posted a comment)
  • -email is unavailable- added by mason (Submitted the item)

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

    Only logged-in users can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-08-13 goldsimon StatusNone => Fixed
        Assigned toNone => goldsimon
        Open/ClosedOpen => Closed
        Planned Release => 1.5.0

    Back to the top

    Powered by Savane 3.5