mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
prevent possible segfault std::string if value NULL
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user