From: Simon Goldschmidt Date: Wed, 24 Apr 2013 20:20:12 +0000 (+0200) Subject: fixed possible division by zero X-Git-Url: http://rtime.felk.cvut.cz/gitweb/pes-rpp/rpp-lwip.git/commitdiff_plain/252126cf767682c27d765cf3efa3a750a609961b fixed possible division by zero --- diff --git a/CHANGELOG b/CHANGELOG index 54cc1194..cd627dbf 100644 --- 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 diff --git a/src/core/ipv4/igmp.c b/src/core/ipv4/igmp.c index bd52744f..9cb4c0c6 100644 --- a/src/core/ipv4/igmp.c +++ b/src/core/ipv4/igmp.c @@ -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 */ }