diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-01-04 17:00:06 +0000 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2024-03-02 14:39:40 +0100 |
commit | e63306361245f2c874930f208697c3e57d808853 (patch) | |
tree | 836d820b15ef3dde51e32b62f8e8d3e16bf27361 | |
parent | f02b1851b240d9922e5c94c3884c722cf5adecdb (diff) |
std::size/SAL_N_ELEMENTS also counts the null terminator
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.cxx | 8 |
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 ); |