[Libreoffice-commits] core.git: tools/source

Caolán McNamara caolanm at redhat.com
Thu Mar 2 21:11:33 UTC 2017


 tools/source/stream/stream.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 74d20cc4c3346398c17f4f4ece7e462363f71868
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Mar 2 20:39:12 2017 +0000

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 99a4d22..d9e99b4 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;


More information about the Libreoffice-commits mailing list