aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--external/easylogging++/easylogging++.h1
-rw-r--r--tests/unit_tests/logging.cpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/external/easylogging++/easylogging++.h b/external/easylogging++/easylogging++.h
index c4a88339f..b983a796c 100644
--- a/external/easylogging++/easylogging++.h
+++ b/external/easylogging++/easylogging++.h
@@ -2026,6 +2026,7 @@ class TypedConfigurations : public base::threading::ThreadSafe {
ELPP_INTERNAL_ERROR("Unable to get configuration [" << confName << "] for level ["
<< LevelHelper::convertToString(level) << "]"
<< std::endl << "Please ensure you have properly configured logger.", false);
+ throw; // The exception has to be rethrown, to abort a branch leading to UB.
}
}
return it->second;
diff --git a/tests/unit_tests/logging.cpp b/tests/unit_tests/logging.cpp
index f11b17412..b3ffb9aa6 100644
--- a/tests/unit_tests/logging.cpp
+++ b/tests/unit_tests/logging.cpp
@@ -208,3 +208,10 @@ TEST(logging, operator_equals_segfault)
el::Logger log2("id2", nullptr);
log2 = log1;
}
+
+TEST(logging, empty_configurations_throws)
+{
+ el::Logger log1("id1", nullptr);
+ const el::Configurations cfg;
+ EXPECT_ANY_THROW(log1.configure(cfg));
+}