fixed possible division by zero

This commit is contained in:
Simon Goldschmidt 2013-04-24 22:20:12 +02:00
parent 8609d1e790
commit 252126cf76
2 changed files with 4 additions and 1 deletions

View File

@ -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

View 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 */
}