Fix dereferencing invalid iterator in wxString in UTF-8 build
Fix iterator going past end of string in PosLenToImpl, it can't become end() as the end iterator can't be dereferenced. See #23305. (cherry picked from commit 73ad17db4ec9a48e64ed40f5020918ec9a05a8a5)
This commit is contained in:
parent
365bea9b07
commit
2aac6d611f
@ -240,6 +240,7 @@ All:
|
||||
- Add move ctor and assignment to wxString (Pavel Tyunin, #23224).
|
||||
- Enable large file support in Unix CMake builds (Maarten Bent, #22750).
|
||||
- Update Georgian translations (NorwayFun, #22673).
|
||||
- Don't use invalid iterator in wxString in UTF-8 build (Ian Day, #23305).
|
||||
|
||||
All (GUI):
|
||||
|
||||
|
@ -262,7 +262,7 @@ void wxString::PosLenToImpl(size_t pos, size_t len,
|
||||
// going beyond the end of the string, just as std::string does
|
||||
const const_iterator e(end());
|
||||
const_iterator i(b);
|
||||
while ( len && i <= e )
|
||||
while ( len && i < e )
|
||||
{
|
||||
++i;
|
||||
--len;
|
||||
|
Loading…
Reference in New Issue
Block a user