summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-04 17:00:06 +0000
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-02-27 23:45:14 +0100
commitf75130dcf240f3fe0d11d4374e1ad4e36d92e416 (patch)
tree51c029187bf1b8a53ef884e7959ea16ab267b6cd
parent92b398862f773e49cb5fe4b0363ef99775eac1b7 (diff)
std::size/SAL_N_ELEMENTS also counts the null terminatorcib-6.4-24
which libxml2 2.12 will fail on with error: 'Extra content at the end of the document' Change-Id: I9d5da9fdd826cce8462ede8c510eaea7281b760f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161627 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit cbb17a548b5cc6a99b6ed7735479bb4f2bc40f26) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161643 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--unoxml/qa/unit/domtest.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/unoxml/qa/unit/domtest.cxx b/unoxml/qa/unit/domtest.cxx
index 0a80d2a4cadc..f9bdec2917eb 100644
--- a/unoxml/qa/unit/domtest.cxx
+++ b/unoxml/qa/unit/domtest.cxx
@@ -207,9 +207,9 @@ struct BasicTest : public test::BootstrapFixture
mxErrHandler.set( new ErrorHandler() );
uno::Reference<XDocumentBuilder> xDB( getMultiServiceFactory()->createInstance("com.sun.star.xml.dom.DocumentBuilder"), uno::UNO_QUERY_THROW );
mxDomBuilder.set( xDB );
- mxValidInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(validTestFile), SAL_N_ELEMENTS(validTestFile))) );
- mxWarningInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(warningTestFile), SAL_N_ELEMENTS(warningTestFile))) );
- mxErrorInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(errorTestFile), SAL_N_ELEMENTS(errorTestFile))) );
+ mxValidInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(validTestFile), SAL_N_ELEMENTS(validTestFile)-1)) );
+ mxWarningInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(warningTestFile), SAL_N_ELEMENTS(warningTestFile)-1)) );
+ mxErrorInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(errorTestFile), SAL_N_ELEMENTS(errorTestFile)-1)) );
mxDomBuilder->setErrorHandler(mxErrHandler.get());
}
@@ -293,7 +293,7 @@ struct SerializerTest : public test::BootstrapFixture
mxErrHandler.set( new ErrorHandler() );
uno::Reference<XDocumentBuilder> xDB( getMultiServiceFactory()->createInstance("com.sun.star.xml.dom.DocumentBuilder"), uno::UNO_QUERY_THROW );
mxDomBuilder.set( xDB );
- mxInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(validTestFile), SAL_N_ELEMENTS(validTestFile))) );
+ mxInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(validTestFile), SAL_N_ELEMENTS(validTestFile)-1)) );
mxDomBuilder->setErrorHandler(mxErrHandler.get());
mxHandler.set( new DocumentHandler );
mxTokHandler.set( new TokenHandler );