From 2c1738d6e28106540085cbb5e17fc24617d6e7f4 Mon Sep 17 00:00:00 2001 From: Markus Volk Date: Fri, 10 Jan 2020 22:30:25 +0100 Subject: [PATCH] record.cpp: increase destination arrays to avoid possible truncation Signed-off-by: MarkusVolk Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ec13dd50c3609514054ebab8c0b70d25e97063ca Author: Markus Volk Date: 2020-01-10 (Fri, 10 Jan 2020) --- src/driver/record.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 4e9543290..3574d29e9 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -317,7 +317,7 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) bool CRecordInstance::Stop(bool remove_event) { - char buf[FILENAMEBUFFERSIZE]={0}; + char buf[FILENAMEBUFFERSIZE+4]={0}; struct stat test; snprintf(buf,sizeof(buf), "%s.xml", filename); @@ -873,7 +873,7 @@ void CRecordInstance::GetRecordString(std::string &str, std::string &dur) //NI int err = GetStatus(); strftime(stime, sizeof(stime), "%H:%M:%S ", localtime(&start_time)); time_t duration = (time(0) - start_time) / 60; - char dtime[20]; + char dtime[22]; int h = duration / 60; int m = duration - (h * 60); snprintf(dtime, sizeof(dtime), "(%d %s %02d %s)", h, h == 1 ? g_Locale->getText(LOCALE_RECORDING_TIME_HOUR) : g_Locale->getText(LOCALE_RECORDING_TIME_HOURS),