]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
fixed possible division by zero
authorSimon Goldschmidt <goldsimon@gmx.de>
Wed, 24 Apr 2013 20:20:12 +0000 (22:20 +0200)
committerSimon Goldschmidt <goldsimon@gmx.de>
Wed, 24 Apr 2013 20:20:12 +0000 (22:20 +0200)
CHANGELOG
src/core/ipv4/igmp.c

index 54cc1194a0beece54f1804a5b6f8052e7b6f3f5e..cd627dbf07626b34be63a02d0a9d79a09b854d0d 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -80,6 +80,9 @@ HISTORY
 
  ++ Bugfixes:
 
+  2013-04-24: Simon Goldschmidt
+  * igmp.c: fixed possible division by zero
+
   2013-04-24: Simon Goldschmidt
   * ip6.h, some ipv6 C files: fixed bug #38526 Coverity: Recursive Header Inclusion in ip6.h
 
index bd52744f901b0928f3cc8787f1bbc03ed4609d2d..9cb4c0c6cafdccca025b38989367b7093d822d79 100644 (file)
@@ -701,7 +701,7 @@ igmp_start_timer(struct igmp_group *group, u8_t max_time)
   }
 #ifdef LWIP_RAND
   /* ensure the random value is > 0 */
-  group->timer = (LWIP_RAND() % (max_time - 1)) + 1;
+  group->timer = (LWIP_RAND() % max_time);
 #endif /* LWIP_RAND */
 }