From d0765efa4fcc84e78757cf6701f7d591a8582617 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 13 Oct 2019 22:24:13 +0200 Subject: [PATCH] rcinput:killTimer check if iterator is not corrupted, possible segfault Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a8d0b49aedcc081b008d76031b1a9ca3e179135a Author: Jacek Jendrzej Date: 2019-10-13 (Sun, 13 Oct 2019) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 2bae7eb77..70ba98973 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -524,12 +524,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);