mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-25 08:54:19 +08:00
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. Closes #23305.
This commit is contained in:
@@ -229,7 +229,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;
|
||||
|
||||
Reference in New Issue
Block a user