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:
Jacek Jendrzej
2015-03-20 11:57:12 +01:00
parent ea6ba212f1
commit 315f5a4b4d
5 changed files with 45 additions and 18 deletions

View File

@@ -453,9 +453,14 @@ bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void * Data)
xmlNodePtr search = xmlDocGetRootElement(parser)->xmlChildrenNode;
while (search) {
if (!strcmp(xmlGetName(search), "zone")) {
name = xmlGetAttribute(search, "name");
const char *nptr = xmlGetAttribute(search, "name");
if(nptr)
name = nptr;
if(g_settings.timezone == name) {
zone = xmlGetAttribute(search, "zone");
const char *zptr = xmlGetAttribute(search, "zone");
if(zptr)
zone = zptr;
if (!access("/usr/share/zoneinfo/" + zone, R_OK))
found = true;
break;