wxTextCtrk::GetRange() shouldn't crash on out of range request
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53729 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -40,7 +40,9 @@
|
|||||||
wxString wxTextEntryBase::GetRange(long from, long to) const
|
wxString wxTextEntryBase::GetRange(long from, long to) const
|
||||||
{
|
{
|
||||||
wxString sel;
|
wxString sel;
|
||||||
if ( from < to )
|
wxString value = GetValue();
|
||||||
|
|
||||||
|
if ((from < to) && ((long)value.length() >= to + from))
|
||||||
{
|
{
|
||||||
sel = GetValue().substr(from, to - from);
|
sel = GetValue().substr(from, to - from);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user