mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
driver/record.cpp: fix crash due to epgdata.info1 len more than buffer size
Origin commit data
------------------
Commit: cbdab7d8c0
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2015-01-14 (Wed, 14 Jan 2015)
This commit is contained in:
@@ -723,7 +723,7 @@ void CRecordInstance::MakeExtFileName(CZapitChannel * channel, std::string &File
|
|||||||
|
|
||||||
std::string channel_name = channel->getName();
|
std::string channel_name = channel->getName();
|
||||||
if (!(channel_name.empty())) {
|
if (!(channel_name.empty())) {
|
||||||
strcpy(buf, UTF8_TO_FILESYSTEM_ENCODING(channel_name.c_str()));
|
snprintf(buf, sizeof(buf), UTF8_TO_FILESYSTEM_ENCODING(channel_name.c_str()));
|
||||||
ZapitTools::replace_char(buf);
|
ZapitTools::replace_char(buf);
|
||||||
StringReplace(FilenameTemplate,"%C",buf);
|
StringReplace(FilenameTemplate,"%C",buf);
|
||||||
}
|
}
|
||||||
@@ -733,7 +733,7 @@ void CRecordInstance::MakeExtFileName(CZapitChannel * channel, std::string &File
|
|||||||
CShortEPGData epgdata;
|
CShortEPGData epgdata;
|
||||||
if(CEitManager::getInstance()->getEPGidShort(epgid, &epgdata)) {
|
if(CEitManager::getInstance()->getEPGidShort(epgid, &epgdata)) {
|
||||||
if (!(epgdata.title.empty())) {
|
if (!(epgdata.title.empty())) {
|
||||||
strcpy(buf, epgdata.title.c_str());
|
snprintf(buf, sizeof(buf), epgdata.title.c_str());
|
||||||
ZapitTools::replace_char(buf);
|
ZapitTools::replace_char(buf);
|
||||||
StringReplace(FilenameTemplate,"%T",buf);
|
StringReplace(FilenameTemplate,"%T",buf);
|
||||||
}
|
}
|
||||||
@@ -741,7 +741,7 @@ void CRecordInstance::MakeExtFileName(CZapitChannel * channel, std::string &File
|
|||||||
StringReplace(FilenameTemplate,"%T","no_title");
|
StringReplace(FilenameTemplate,"%T","no_title");
|
||||||
|
|
||||||
if (!(epgdata.info1.empty())) {
|
if (!(epgdata.info1.empty())) {
|
||||||
strcpy(buf, epgdata.info1.c_str());
|
snprintf(buf, sizeof(buf), epgdata.info1.c_str());
|
||||||
ZapitTools::replace_char(buf);
|
ZapitTools::replace_char(buf);
|
||||||
StringReplace(FilenameTemplate,"%I",buf);
|
StringReplace(FilenameTemplate,"%I",buf);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user