summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-02 20:39:12 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-03-02 21:11:01 +0000
commit74d20cc4c3346398c17f4f4ece7e462363f71868 (patch)
tree4926d9a1d4f8e520049f1f1b9725f80ddd003e52 /tools
parente7e4ecf4f69967351b6b6fd5e29749fd141c95b0 (diff)
ReAllocateMemory mustn't delete data it doesn't own
Change-Id: I09725cd21973ace1aab22de17bdae2023a739212 Reviewed-on: https://gerrit.libreoffice.org/34831 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/stream/stream.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 99a4d22b4de4..d9e99b40522d 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1830,6 +1830,9 @@ bool SvMemoryStream::AllocateMemory( std::size_t nNewSize )
// (using Bozo algorithm)
bool SvMemoryStream::ReAllocateMemory( long nDiff )
{
+ if (!bOwnsData)
+ return false;
+
bool bRetVal = false;
long nTemp = (long)nSize;
nTemp += nDiff;