mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-04 20:28:29 +02:00
sectionsd: -fix possible buf overflow & skip read EPG cache if index.tmp available
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2122 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: a397eaef58
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2012-02-25 (Sat, 25 Feb 2012)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -4582,13 +4582,21 @@ static void *insertEventsfromFile(void *)
|
|||||||
t_original_network_id onid = 0;
|
t_original_network_id onid = 0;
|
||||||
t_transport_stream_id tsid = 0;
|
t_transport_stream_id tsid = 0;
|
||||||
t_service_id sid = 0;
|
t_service_id sid = 0;
|
||||||
char cclass[20];
|
char cclass[20]={0};
|
||||||
char cuser[20];
|
char cuser[20]={0};;
|
||||||
std::string indexname;
|
std::string indexname;
|
||||||
std::string filename;
|
std::string filename;
|
||||||
std::string epgname;
|
std::string epgname;
|
||||||
int ev_count = 0;
|
int ev_count = 0;
|
||||||
|
|
||||||
|
struct stat buf;
|
||||||
|
indexname = epg_dir + "index.tmp";
|
||||||
|
//skip read EPG cache if index.tmp available
|
||||||
|
if (stat(indexname.c_str(), &buf) == 0){
|
||||||
|
reader_ready = true;
|
||||||
|
pthread_exit(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
indexname = epg_dir + "index.xml";
|
indexname = epg_dir + "index.xml";
|
||||||
|
|
||||||
xmlDocPtr index_parser = parseXmlFile(indexname.c_str());
|
xmlDocPtr index_parser = parseXmlFile(indexname.c_str());
|
||||||
@@ -4672,12 +4680,14 @@ static void *insertEventsfromFile(void *)
|
|||||||
node = node->xmlNextNode;
|
node = node->xmlNextNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
int count = 0;
|
unsigned int count = 0;
|
||||||
while (xmlGetNextOccurence(node, "content") != NULL) {
|
while (xmlGetNextOccurence(node, "content") != NULL) {
|
||||||
cclass[count] = xmlGetNumericAttribute(node, "class", 16);
|
cclass[count] = xmlGetNumericAttribute(node, "class", 16);
|
||||||
cuser[count] = xmlGetNumericAttribute(node, "user", 16);
|
cuser[count] = xmlGetNumericAttribute(node, "user", 16);
|
||||||
node = node->xmlNextNode;
|
node = node->xmlNextNode;
|
||||||
count++;
|
count++;
|
||||||
|
if(count > sizeof(cclass)-1)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
e.contentClassification = std::string(cclass, count);
|
e.contentClassification = std::string(cclass, count);
|
||||||
e.userClassification = std::string(cuser, count);
|
e.userClassification = std::string(cuser, count);
|
||||||
|
Reference in New Issue
Block a user