record.cpp: increase destination arrays to avoid possible truncation

Signed-off-by: MarkusVolk <f_l_k@t-online.de>
This commit is contained in:
MarkusVolk
2020-01-10 07:18:05 +01:00
committed by Thilo Graf
parent 55dbe62c16
commit f304acb4e5

View File

@@ -314,7 +314,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);
@@ -848,7 +848,7 @@ void CRecordInstance::GetRecordString(std::string &str, std::string &dur)
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),