mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
rcinput: avoid theoretically possible timerid overflow
This commit is contained in:
committed by
Jacek Jendrzej
parent
17ba068850
commit
081e35b3e5
@@ -350,6 +350,11 @@ int CRCInput::addTimer(uint64_t Interval, bool oneshot, bool correct_time )
|
|||||||
_newtimer.interval = 0;
|
_newtimer.interval = 0;
|
||||||
|
|
||||||
_newtimer.id = timerid++;
|
_newtimer.id = timerid++;
|
||||||
|
/* in theory, this uint32_t could overflow... */
|
||||||
|
/* ...and timerid == 0 is used as "no timer" in many places. */
|
||||||
|
if (timerid == 0)
|
||||||
|
timerid++;
|
||||||
|
|
||||||
if ( correct_time )
|
if ( correct_time )
|
||||||
_newtimer.times_out = timeNow+ Interval;
|
_newtimer.times_out = timeNow+ Interval;
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user