rcinput:killTimer check if iterator is not corrupted, possible segfault

This commit is contained in:
Jacek Jendrzej
2019-10-13 16:42:49 +02:00
parent 06e6fd5904
commit 907c5b52ce

View File

@@ -520,12 +520,13 @@ int CRCInput::checkTimers()
else
_newtimer.times_out = e->times_out + e->interval;
timers.erase(e);
timers.erase(e);
for ( e= timers.begin(); e!= timers.end(); ++e )
if ( e->times_out> _newtimer.times_out )
break;
timers.insert(e, _newtimer);
if(e != timers.end())
timers.insert(e, _newtimer);
}
else
timers.erase(e);