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

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


The following commit(s) were added to refs/heads/master by this push:
     new e46c77ad Fix out of bounds memory access (#473)
e46c77ad is described below

commit e46c77ad1d259996228179c98600dc6b52f095a0
Author: Robert Middleton <[email protected]>
AuthorDate: Sun Feb 2 10:49:54 2025 -0500

    Fix out of bounds memory access (#473)
    
    If the attribute for an XML entry is over 2000 characters long and happens
    to end with a `\`, the iterator can be incremented past the end of the 
string.
---
 src/main/cpp/optionconverter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/cpp/optionconverter.cpp b/src/main/cpp/optionconverter.cpp
index be7dee76..6fa7b502 100644
--- a/src/main/cpp/optionconverter.cpp
+++ b/src/main/cpp/optionconverter.cpp
@@ -85,7 +85,7 @@ LogString OptionConverter::convertSpecialChars(const 
LogString& s)
        {
                c = *i++;
 
-               if (c == 0x5C /* '\\' */)
+               if (i != s.end() && c == 0x5C /* '\\' */)
                {
                        c =  *i++;
 

Reply via email to