From: Vadim Zeitlin Date: Fri, 20 Jan 2006 00:55:17 +0000 (+0000) Subject: don't look beyond the end of the string if it ends with a backslash in FilterInEntryN... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d9f5d54a5a7a7ac7edb930ae3979349c158c2f18 don't look beyond the end of the string if it ends with a backslash in FilterInEntryName() (thanks Purify) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index c70e7e5a5c..70676fa8ed 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -2030,8 +2030,11 @@ static wxString FilterInEntryName(const wxString& str) strResult.Alloc(str.Len()); for ( const wxChar *pc = str.c_str(); *pc != '\0'; pc++ ) { - if ( *pc == wxT('\\') ) - pc++; + if ( *pc == wxT('\\') ) { + // we need to test it here or we'd skip past the NUL in the loop line + if ( *++pc == _T('\0') ) + break; + } strResult += *pc; }