]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Fix a potential time-wraparound issue in pinger.c.
authorSimon Tatham <anakin@pobox.com>
Fri, 1 Apr 2016 12:27:03 +0000 (13:27 +0100)
committerSimon Tatham <anakin@pobox.com>
Sat, 2 Apr 2016 06:51:24 +0000 (07:51 +0100)
commitb4202c917a1e59dba2790463995959a2c2da745a
tree8d21945aa95b793fd2e14af31abc171d61cb866d
parent46051027fbd16badfa72947a4763750c7e560a92
Fix a potential time-wraparound issue in pinger.c.

A compiler warning drew my attention to the fact that 'next' in
pinger_schedule() was an int, not the unsigned long it should have
been. And looking at the code that handles it, it was also taking no
care with integer wraparound when checking whether an existing
scheduled ping should be moved forward.

So now I do something a bit more robust, by remembering what time it
_was_ when we set pinger->next, and checking if the new time value
falls in the interval between those two times.
pinger.c
putty.h
timing.c