This is an automated email from the ASF dual-hosted git repository.

swebb2066 pushed a commit to branch replace_unsafe_cast
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git

commit 1e0c51bb4f07431bbd302796ffbe2dc3643f945e
Author: Stephen Webb <[email protected]>
AuthorDate: Thu Oct 30 16:17:29 2025 +1100

    Prevent potential fault configuring a user-defined Level
---
 src/main/cpp/domconfigurator.cpp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/main/cpp/domconfigurator.cpp b/src/main/cpp/domconfigurator.cpp
index 6983c9be..d54a092a 100644
--- a/src/main/cpp/domconfigurator.cpp
+++ b/src/main/cpp/domconfigurator.cpp
@@ -824,10 +824,7 @@ void DOMConfigurator::parseLevel(
 
                        try
                        {
-                               Level::LevelClass& levelClass =
-                                       
(Level::LevelClass&)Loader::loadClass(className);
-                               LevelPtr level = levelClass.toLevel(levelStr);
-                               logger->setLevel(level);
+                               logger->setLevel(dynamic_cast<const 
Level::LevelClass&>(Loader::loadClass(className)).toLevel(levelStr));
                        }
                        catch (Exception& oops)
                        {

Reply via email to