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

Submitted by:  Mathias Hjärtström <hjartstrom>
Submitted on:  Tue 12 Nov 2013 10:14:17 AM UTC  
 
Category: IPv4Severity: 3 - Normal
Item Group: Crash ErrorStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned 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>
Project AdministratorIn charge of this item.
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>

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 20 Feb 2014 09:08:42 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1