Author: tschoening Date: Sun Feb 9 19:59:31 2014 New Revision: 1566384 URL: http://svn.apache.org/r1566384 Log: LOGCXX-388: Hierarchy::updateParents loops forever on illegal logger-name like '.logger1'
Modified: incubator/log4cxx/trunk/src/changes/changes.xml incubator/log4cxx/trunk/src/main/cpp/hierarchy.cpp Modified: incubator/log4cxx/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/changes/changes.xml?rev=1566384&r1=1566383&r2=1566384&view=diff ============================================================================== --- incubator/log4cxx/trunk/src/changes/changes.xml (original) +++ incubator/log4cxx/trunk/src/changes/changes.xml Sun Feb 9 19:59:31 2014 @@ -64,6 +64,7 @@ <action issue="LOGCXX-367" type="fix">Build fails on Linux with g++ 4.4</action> <action issue="LOGCXX-381" type="fix">Pkgconfig can't find dependencies properly if log4cxx built statically</action> <action issue="LOGCXX-382" type="fix">Mingw build type conversion error</action> + <action issue="LOGCXX-388" type="fix">Hierarchy::updateParents loops forever on illegal logger-name like '.logger1'</action> <action issue="LOGCXX-412" type="fix">Log4cxx doesn't roll normally when working under multiple processes environment</action> <action issue="LOGCXX-413" type="fix">log4cxx doesn't compile on openembedded (due to Alex Zbarcea)</action> <action issue="LOGCXX-414" type="fix">possibly wrong use of autotools docdir (due to Alex Zbarcea)</action> Modified: incubator/log4cxx/trunk/src/main/cpp/hierarchy.cpp URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/hierarchy.cpp?rev=1566384&r1=1566383&r2=1566384&view=diff ============================================================================== --- incubator/log4cxx/trunk/src/main/cpp/hierarchy.cpp (original) +++ incubator/log4cxx/trunk/src/main/cpp/hierarchy.cpp Sun Feb 9 19:59:31 2014 @@ -335,7 +335,7 @@ void Hierarchy::updateParents(LoggerPtr // if name = "w.x.y.z", loop through "w.x.y", "w.x" and "w", but not "w.x.y.z" for(size_t i = name.find_last_of(0x2E /* '.' */, length-1); - i != LogString::npos; + (i != LogString::npos) && (i != 0); i = name.find_last_of(0x2E /* '.' */, i-1)) { LogString substr = name.substr(0, i);