buglwIP - A Lightweight TCP/IP stack - Bugs: bug #40553, Divide by zero

 
 

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

bug #40553: Divide by zero

Submitter:  Mathias Hjärtström <hjartstrom>
Submitted:  Tue 12 Nov 2013 10:14:17 AM UTC
   
 
Category:  IPv4 Severity:  3 - Normal
Item Group:  Crash Error Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  1.4.1

Thu 20 Feb 2014 09:08:42 PM UTC, comment #1: 

Already fixed (differently) back in 2013

Simon Goldschmidt <goldsimon>
Group administrator
Tue 12 Nov 2013 10:14:17 AM UTC, original submission:  

There is a problem in igmp.c, where you easily end up doing a divide by zero and get an exception:

697 static void
698 igmp_start_timer(struct igmp_group *group, u8_t max_time)
699 {
700   /* ensure the input value is > 0 */
701   if (max_time == 0) {
702     max_time = 1;
703   }
704   /* ensure the random value is > 0 */
705   group->timer = (LWIP_RAND() % (max_time - 1)) + 1;
706 }

It should probably read something like:

701   if (max_time <= 1) {
702     group->timer = 1;
703     return;
704   }

Mathias Hjärtström <hjartstrom>

 

(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 hjartstrom (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-20 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code