diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-06-13 14:09:38 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-06-13 14:09:38 +0200 |
commit | a4242df3ae36d9158317298fe01b5cfa0aae4b32 (patch) | |
tree | 56223101be3eb0f98b48eddb98e9a4f1919b47d0 /editeng | |
parent | sw/qa/ooxmltok: explain the fieldmark test a bit more (diff) | |
download | core-a4242df3ae36d9158317298fe01b5cfa0aae4b32.tar.gz core-a4242df3ae36d9158317298fe01b5cfa0aae4b32.zip |
Take care of short strings
Change-Id: I469b27a45bb5676570b59a829419f3959210a1a6
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index fe747c35786a..08722a51b7c3 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -68,6 +68,7 @@ #include <tools/shl.hxx> #include <com/sun/star/i18n/ScriptType.hpp> +#include <cassert> #include <limits> #include <boost/bind.hpp> @@ -2064,6 +2065,8 @@ XubString EditDoc::GetText( LineEnd eEnd ) const pCur += nSepSize; } } + assert(pCur - newStr->buffer <= newStr->length); + newStr->length = pCur - newStr->buffer; return rtl::OUString(newStr, SAL_NO_ACQUIRE); } |