[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - connectivity/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 10 07:48:57 UTC 2021


 connectivity/source/drivers/firebird/Blob.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit c3cdc29900574fefe4dc8b90e2941f2d3371d89c
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Fri Sep 10 00:49:49 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Sep 10 09:48:23 2021 +0200

    tdf#120129: don't forget to update buffer size to actual length
    
    Otherwise extra bytes get written to the resulting string from the
    too long buffer.
    
    Change-Id: Iccde16b8002f214df6f86f484f288ec464c6b674
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121872
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 541ddf4580cac8c3f9590be26a487f5fc8e2553c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121874
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/connectivity/source/drivers/firebird/Blob.cxx b/connectivity/source/drivers/firebird/Blob.cxx
index d254ba49431a..edcc0d233989 100644
--- a/connectivity/source/drivers/firebird/Blob.cxx
+++ b/connectivity/source/drivers/firebird/Blob.cxx
@@ -144,6 +144,9 @@ bool Blob::readOneSegment(uno::Sequence< sal_Int8 >& rDataOut)
         OUString sError(StatusVectorToString(m_statusVector, u"isc_get_segment"));
         throw IOException(sError, *this);
     }
+
+    if (rDataOut.getLength() > nActualSize)
+        rDataOut.realloc(nActualSize);
     m_nBlobPosition += nActualSize;
     return aRet == isc_segstr_eof;  // last segment read
 }


More information about the Libreoffice-commits mailing list