[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - writerperfect/source

David Tardon dtardon at redhat.com
Tue Feb 27 19:41:44 UTC 2018


 writerperfect/source/common/WPXSvInputStream.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit f3c742dca6b304da8557f5ca9fb5c287cf5ac934
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Feb 27 17:47:19 2018 +0100

    set number of read bytes correctly
    
    It was wrong if we read less than was expected.
    
    Thanks to Antti Levomäki and Christian Jalio from Forcepoint.
    
    Change-Id: I070c1731d1aace4c101fa01efed0c28734c44899
    (cherry picked from commit 9534a8fe3e84bfcc7d0d2addac4dd8cd96746d99)
    Reviewed-on: https://gerrit.libreoffice.org/50462
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx
index 75a56b35fa78..7483a28dbee4 100644
--- a/writerperfect/source/common/WPXSvInputStream.cxx
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
@@ -877,7 +877,10 @@ const unsigned char *WPXSvInputStream::read(unsigned long numBytes, unsigned lon
     if (!mpImpl->mnReadBufferLength)
         return nullptr;
 
-    numBytesRead = numBytes;
+    if (numBytes <= mpImpl->mnReadBufferLength)
+        numBytesRead = numBytes;
+    else
+        numBytesRead = mpImpl->mnReadBufferLength;
 
     mpImpl->mnReadBufferPos += numBytesRead;
     return mpImpl->mpReadBuffer;


More information about the Libreoffice-commits mailing list