mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 09:21:09 +02:00
prevent possible segfault std::string if value NULL
Origin commit data
------------------
Branch: ni/coolstream
Commit: 40fe7fae34
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2015-03-20 (Fri, 20 Mar 2015)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -481,7 +481,9 @@ printf("CFileBrowser::readDir_sc: read done, size %d\n", (int)answer.size());
|
||||
CFile file;
|
||||
if (xml_decode == 1) {
|
||||
file.Mode = S_IFDIR + 0777 ;
|
||||
file.Name = xmlGetAttribute(element, "name");
|
||||
const char *eptr = xmlGetAttribute(element, "name");
|
||||
if(eptr)
|
||||
file.Name = eptr;
|
||||
file.Url = sc_get_genre + file.Name;
|
||||
file.Size = 0;
|
||||
file.Time = 0;
|
||||
@@ -498,8 +500,14 @@ printf("CFileBrowser::readDir_sc: read done, size %d\n", (int)answer.size());
|
||||
ptr = xmlGetAttribute(element, "mt");
|
||||
if (ptr && (strcmp(ptr, "audio/mpeg")==0)) {
|
||||
file.Mode = S_IFREG + 0777 ;
|
||||
file.Name = xmlGetAttribute(element, "name");
|
||||
file.Url = sc_tune_in_base + tunein_base + (std::string)"?id=" + xmlGetAttribute(element, "id") + (std::string)"&k=" + g_settings.shoutcast_dev_id;
|
||||
const char *aptr = xmlGetAttribute(element, "name");
|
||||
if(aptr)
|
||||
file.Name = aptr;
|
||||
const char *idptr = xmlGetAttribute(element, "id");
|
||||
std::string id;
|
||||
if(idptr)
|
||||
id = idptr;
|
||||
file.Url = sc_tune_in_base + tunein_base + (std::string)"?id=" + id + (std::string)"&k=" + g_settings.shoutcast_dev_id;
|
||||
//printf("adding %s (%s)\n", file.Name.c_str(), file.Url.c_str());
|
||||
ptr = xmlGetAttribute(element, "br");
|
||||
if (ptr) {
|
||||
|
@@ -146,15 +146,21 @@ CMenuOptionStringChooser* COsdLangSetup::getTzItems()
|
||||
{
|
||||
if (!strcmp(xmlGetName(search), "zone"))
|
||||
{
|
||||
std::string name = xmlGetAttribute(search, "name");
|
||||
std::string zone = xmlGetAttribute(search, "zone");
|
||||
const char* zptr = xmlGetAttribute(search, "zone");
|
||||
std::string zone;
|
||||
if(zptr)
|
||||
zone = zptr;
|
||||
//printf("Timezone: %s -> %s\n", name.c_str(), zone.c_str());
|
||||
if (access("/usr/share/zoneinfo/" + zone, R_OK))
|
||||
printf("[neutrino] timezone file '%s' not installed\n", zone.c_str());
|
||||
else
|
||||
{
|
||||
tzSelect->addOption(name);
|
||||
found = true;
|
||||
const char* ptr = xmlGetAttribute(search, "name");
|
||||
if(ptr){
|
||||
std::string name = ptr;
|
||||
tzSelect->addOption(name);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
search = search->xmlNextNode;
|
||||
@@ -172,7 +178,6 @@ CMenuOptionStringChooser* COsdLangSetup::getTzItems()
|
||||
return tzSelect;
|
||||
}
|
||||
|
||||
|
||||
//shows locale setup for language selection
|
||||
void COsdLangSetup::showLanguageSetup(CMenuWidget *osdl_setup)
|
||||
{
|
||||
|
Reference in New Issue
Block a user