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

Submitter:  Mason <mason>
Submitted:  Wed 13 Jun 2012 07:43:01 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Crash Error Status:  Fixed
Privacy:  Public Assigned to:  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>
Group administrator
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>
Group 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>

 

(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 kieranm (Posted a comment)
  • -email is unavailable- added by mason (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-08-13 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
        Planned Release 1.5.0

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code