diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2018-11-29 18:59:22 +0000 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2018-11-29 18:59:22 +0000 |
commit | e382276dcc7b2340c8f72251bd9c28c29776890a (patch) | |
tree | 6d3cf63ba3bf53706b8388b90c4091d615a35435 /indra | |
parent | f3b2ac0858e1dff226892e25cd1cebbe98a225a3 (diff) | |
parent | 13f8cfd1c27a5ca0d9b66a38cbe11fc96a123a8c (diff) |
Merged in andreykproductengine/maint-neko (pull request #724)
SL-9954 Mac Viewer crashes if logcontrol-dev.xml is modified
Approved-by: Andrey Lihatskiy <andreylproductengine@lindenlab.com>
Approved-by: Simon Linden <simon@lindenlab.com>
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/llerror.cpp | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 40eb7d9bac..17d8164289 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -382,15 +382,22 @@ namespace { llifstream file(filename().c_str()); - if (file.is_open()) + if (!file.is_open()) { - LLSDSerialize::fromXML(configuration, file); + LL_WARNS() << filename() << " failed to open file; not changing configuration" << LL_ENDL; + return false; + } + + if (LLSDSerialize::fromXML(configuration, file) == LLSDParser::PARSE_FAILURE) + { + LL_WARNS() << filename() << " parcing error; not changing configuration" << LL_ENDL; + return false; } - if (configuration.isUndefined()) + if (configuration.isUndefined() || !configuration.isMap() || configuration.emptyMap()) { - LL_WARNS() << filename() << " missing, ill-formed," - " or simply undefined; not changing configuration" + LL_WARNS() << filename() << " missing, ill-formed, or simply undefined" + " content; not changing configuration" << LL_ENDL; return false; } @@ -856,19 +863,24 @@ namespace LLError setEnabledLogTypesMask(config["enabled-log-types-mask"].asInteger()); } - LLSD sets = config["settings"]; - LLSD::array_const_iterator a, end; - for (a = sets.beginArray(), end = sets.endArray(); a != end; ++a) - { - const LLSD& entry = *a; - - ELevel level = decodeLevel(entry["level"]); - - setLevels(s->mFunctionLevelMap, entry["functions"], level); - setLevels(s->mClassLevelMap, entry["classes"], level); - setLevels(s->mFileLevelMap, entry["files"], level); - setLevels(s->mTagLevelMap, entry["tags"], level); - } + if (config.has("settings") && config["settings"].isArray()) + { + LLSD sets = config["settings"]; + LLSD::array_const_iterator a, end; + for (a = sets.beginArray(), end = sets.endArray(); a != end; ++a) + { + const LLSD& entry = *a; + if (entry.isMap() && !entry.emptyMap()) + { + ELevel level = decodeLevel(entry["level"]); + + setLevels(s->mFunctionLevelMap, entry["functions"], level); + setLevels(s->mClassLevelMap, entry["classes"], level); + setLevels(s->mFileLevelMap, entry["files"], level); + setLevels(s->mTagLevelMap, entry["tags"], level); + } + } + } } } |