From 92f747d30cf6bc7d8d5c268d5a592e17decc5a0a Mon Sep 17 00:00:00 2001 From: satbaby Date: Wed, 6 Jun 2012 20:59:11 +0200 Subject: [PATCH] sectionsd.cpp: fix Segmentation fault if max_events == 0 --- src/eitd/sectionsd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 1ee4b307c..dc4686d32 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -439,7 +439,7 @@ xprintf("addEvent: current %016llx event %016llx running %d messaging_got_CN %d\ } deleteEvent(e->uniqueKey()); readLockEvents(); - if (mySIeventsOrderUniqueKey.size() >= max_events) { + if ( !mySIeventsOrderUniqueKey.empty() && mySIeventsOrderUniqueKey.size() >= max_events && max_events != 0 ) { MySIeventsOrderFirstEndTimeServiceIDEventUniqueKey::iterator lastEvent = mySIeventsOrderFirstEndTimeServiceIDEventUniqueKey.begin(); @@ -557,7 +557,7 @@ static void addNVODevent(const SIevent &evt) // mehrere Events mit gleicher ID sind, diese vorher loeschen deleteEvent(e->uniqueKey()); readLockEvents(); - if (mySIeventsOrderUniqueKey.size() >= max_events) { + if ( !mySIeventsOrderUniqueKey.empty() && mySIeventsOrderUniqueKey.size() >= max_events && max_events != 0 ) { //TODO: Set Old Events to 0 if limit is reached... MySIeventsOrderFirstEndTimeServiceIDEventUniqueKey::iterator lastEvent = mySIeventsOrderFirstEndTimeServiceIDEventUniqueKey.end();