fixed bug #34337 (possible NULL pointer in sys_check_timeouts)

This commit is contained in:
goldsimon 2011-09-20 07:21:19 +02:00
parent d6227aece6
commit f13615d97a
2 changed files with 12 additions and 9 deletions

View File

@ -57,6 +57,9 @@ HISTORY
++ Bugfixes:
2011-09-20: Simon Goldschmidt
* timers.c: fixed bug #34337 (possible NULL pointer in sys_check_timeouts)
2011-09-11: Simon Goldschmidt
* tcp_out.c: use pcb->mss instead of TCP_MSS for preallocate mss-sized pbufs
(bug #34019)

View File

@ -416,15 +416,15 @@ sys_untimeout(sys_timeout_handler handler, void *arg)
void
sys_check_timeouts(void)
{
struct sys_timeo *tmptimeout;
u32_t diff;
sys_timeout_handler handler;
void *arg;
int had_one;
u32_t now;
now = sys_now();
if (next_timeout) {
struct sys_timeo *tmptimeout;
u32_t diff;
sys_timeout_handler handler;
void *arg;
u8_t had_one;
u32_t now;
now = sys_now();
/* this cares for wraparounds */
diff = LWIP_U32_DIFF(now, timeouts_last_time);
do
@ -434,7 +434,7 @@ sys_check_timeouts(void)
#endif /* PBUF_POOL_FREE_OOSEQ */
had_one = 0;
tmptimeout = next_timeout;
if (tmptimeout->time <= diff) {
if (tmptimeout && (tmptimeout->time <= diff)) {
/* timeout has expired */
had_one = 1;
timeouts_last_time = now;