From d61b9745bc2654108b860e19181aca5f892d70d1 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 21 Sep 2017 18:45:47 +0200 Subject: [PATCH 1/2] fix use stack after scope --- src/eitd/sectionsd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index e5619d321..0173462da 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1428,8 +1428,8 @@ void CTimeThread::run() { time_t dvb_time = 0; xprintf("%s::run:: starting, pid %d (%lu)\n", name.c_str(), getpid(), pthread_self()); - const char *tn = ("sd:" + name).c_str(); - set_threadname(tn); + const std::string tn = ("sd:" + name).c_str(); + set_threadname(tn.c_str()); addFilters(); DMX::start(); @@ -1543,8 +1543,8 @@ int CSectionThread::Sleep() void CSectionThread::run() { xprintf("%s::run:: starting, pid %d (%lu)\n", name.c_str(), getpid(), pthread_self()); - const char *tn = ("sd:" + name).c_str(); - set_threadname(tn); + const std::string tn = ("sd:" + name).c_str(); + set_threadname(tn.c_str()); if (sections_debug) dump_sched_info(name); From bdd23e0ece32909739539f265be535824af3e019 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 21 Sep 2017 18:46:21 +0200 Subject: [PATCH 2/2] fix stack buffer underflow --- src/gui/components/cc_timer.cpp | 2 +- src/gui/components/cc_timer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index f3ef5b751..738f2d01f 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -58,7 +58,7 @@ CComponentsTimer::~CComponentsTimer() void CComponentsTimer::runSharedTimerAction() { //start loop - string tn = "cc:"+name; + tn = "cc:"+name; set_threadname(tn.c_str()); while(tm_enable && tm_interval > 0) { tm_mutex.lock(); diff --git a/src/gui/components/cc_timer.h b/src/gui/components/cc_timer.h index c7e2d21cd..dc6d090c7 100644 --- a/src/gui/components/cc_timer.h +++ b/src/gui/components/cc_timer.h @@ -65,7 +65,7 @@ class CComponentsTimer : public sigc::trackable ///name for the thread std::string name; - + std::string tn; ///mutex for timer OpenThreads::Mutex tm_mutex; ///slot for restart signals