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 a5ef154b When calculating the short filename, make sure it is not null 
(#354)
a5ef154b is described below

commit a5ef154bc33a4f19a00eff5517385ad2a3da4b54
Author: Robert Middleton <[email protected]>
AuthorDate: Tue Feb 20 23:07:59 2024 -0500

    When calculating the short filename, make sure it is not null (#354)
---
 src/main/include/log4cxx/spi/location/locationinfo.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/main/include/log4cxx/spi/location/locationinfo.h 
b/src/main/include/log4cxx/spi/location/locationinfo.h
index 92cf4cf8..1dd97f8b 100644
--- a/src/main/include/log4cxx/spi/location/locationinfo.h
+++ b/src/main/include/log4cxx/spi/location/locationinfo.h
@@ -59,6 +59,7 @@ class LOG4CXX_EXPORT LocationInfo
 
 #ifdef LOG4CXX_HAS_STRING_VIEW
                static constexpr const char* calcShortFileName(const char* 
fileName){
+                       if(fileName == nullptr) return NA;
                        std::string_view view(fileName);
                        // If the separator is not found, rfind will return -1. 
 Adding 1 to
                        // that will have it pointing at fileName, which is a 
good fallback.

Reply via email to