X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2cce705aad2cb08aaa790c9cede95d0d7386d72a..236a9de39afa090fdee3cf91cb5364ceca69e3f8:/src/common/fileconf.cpp diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 1ee849986d..d9ab373bdb 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -468,20 +468,22 @@ void wxFileConfig::Parse(wxTextFile& file, bool bLocal) } } else { // a key - size_t count = 0; const wxChar *pEnd = pStart; - while ( *pEnd != wxT('=') && !wxIsspace(*pEnd) ) { + while ( *pEnd && *pEnd != wxT('=') && !wxIsspace(*pEnd) ) { if ( *pEnd == wxT('\\') ) { // next character may be space or not - still take it because it's - // quoted + // quoted (unless there is nothing) pEnd++; + if ( !*pEnd ) { + // the error message will be given below anyhow + break; + } } - count++; pEnd++; } - wxString strKey(FilterInEntryName(wxString(pStart, count))); + wxString strKey(FilterInEntryName(wxString(pStart, pEnd))); // skip whitespace while ( isspace(*pEnd) )