summaryrefslogtreecommitdiffstats
path: root/connectivity
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-09-10 00:49:49 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-09-11 08:45:57 +0200
commit7c01cd840be90a42a747b17fa23174dc67654583 (patch)
tree8c5fc3f0e79f1f0d8e717528894f2eae0ddc6889 /connectivity
parentindexing: fix correct size and pos. for shapes + more tests (diff)
downloadcore-7c01cd840be90a42a747b17fa23174dc67654583.tar.gz
core-7c01cd840be90a42a747b17fa23174dc67654583.zip
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@collabora.com> (cherry picked from commit 541ddf4580cac8c3f9590be26a487f5fc8e2553c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121875 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit e7e38c23d0a91e80535893ee88e3f0062b7d522c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121889 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/Blob.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/connectivity/source/drivers/firebird/Blob.cxx b/connectivity/source/drivers/firebird/Blob.cxx
index 8ed9fc4a8ac7..854db5bb0df0 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, "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
}