Browse Source

fixed possible division by zero

STABLE-2_1_x
Simon Goldschmidt 13 years ago
parent
commit
252126cf76
  1. 3
      CHANGELOG
  2. 2
      src/core/ipv4/igmp.c

3
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

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

Loading…
Cancel
Save