From 041ba8f5f1b9fa857172cc0bf336b5228d2502ac Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 23 Oct 2014 18:19:28 +0400 Subject: [PATCH] zapit/src/bouquets.cpp: fix possible crash, if no channel name present in bouquets xml Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f8f299eadc5974b21ef05be9d655ebdc8e309794 Author: [CST] Focus Date: 2014-10-23 (Thu, 23 Oct 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/bouquets.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index 0b7ceeb1b..c07eda586 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -405,7 +405,10 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser) newBouquet->bScanEpg = scanepg ? (strcmp(scanepg, "1") == 0) : false; channel_node = search->xmlChildrenNode; while ((channel_node = xmlGetNextOccurence(channel_node, "S")) != NULL) { - std::string name2 = xmlGetAttribute(channel_node, "n"); + std::string name2; + name = xmlGetAttribute(channel_node, "n"); + if (name) + name2 = name; char *url = xmlGetAttribute(channel_node, "u"); GET_ATTR(channel_node, "i", SCANF_SERVICE_ID_TYPE, service_id); GET_ATTR(channel_node, "on", SCANF_ORIGINAL_NETWORK_ID_TYPE, original_network_id);