Skip to content

Commit

Permalink
Fix dereferencing invalid iterator in wxString in UTF-8 build
Browse files Browse the repository at this point in the history
Fix iterator going past end of string in PosLenToImpl, it can't become
end() as the end iterator can't be dereferenced.

Closes #23305.
  • Loading branch information
Zekkers authored and vadz committed Mar 5, 2023
1 parent 77bafdc commit 145aed1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/string.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 145aed1

Please sign in to comment.