diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-10-09 21:01:15 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-09 21:02:11 +0200 |
commit | 34e951bd7284d2e771c279e3adc3899d191fdad0 (patch) | |
tree | 8a2aac81ae8b577397bdc4f6f54e21939dbdde16 /vcl/source/control | |
parent | f58ee783eebf74108c1c1dd5f24e6abaa19c4f09 (diff) |
More OUString::copy out-of-bounds fixes
Change-Id: I45762d167d04252e32155a7b23a3290688bccdf6
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/field2.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index fa3fee23d5cb..162dfff25560 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -19,6 +19,8 @@ #include "sal/config.h" +#include <algorithm> + #include <tools/diagnose_ex.h> #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> @@ -1015,7 +1017,7 @@ static sal_uInt16 ImplCutNumberFromString( OUString& rStr ) ++i2; } sal_Int32 nValue = rStr.copy(i1, i2-i1).toInt32(); - rStr = rStr.copy(i2+1); + rStr = rStr.copy(std::min(i2+1, rStr.getLength())); return nValue; } |