lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #40553] Divide by zero


From: Mathias Hjärtström
Subject: [lwip-devel] [bug #40553] Divide by zero
Date: Tue, 12 Nov 2013 10:14:17 +0000
User-agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)

URL:
  <http://savannah.nongnu.org/bugs/?40553>

                 Summary: Divide by zero
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: hjartstrom
            Submitted on: tis 12 nov 2013 10.14.17
                Category: IPv4
                Severity: 3 - Normal
              Item Group: Crash Error
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: 1.4.1

    _______________________________________________________

Details:

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   }




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?40553>

_______________________________________________
  Meddelandet skickades via/av Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]