From 328b135f0decbab475c16560f4b366559f2d0e66 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 7 Dec 2023 16:00:17 +0100 Subject: xmlsecurity: check for errors in OCipherContext::Create() If this function returns null, storing a document will proceed without reporting an error to the user, and lose all the data. Change-Id: I0f9fd53702321e7997b28e12eb5bed3349bbcc13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160435 Tested-by: Jenkins Reviewed-by: Michael Stahl --- xmlsecurity/source/xmlsec/nss/nssinitializer.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'xmlsecurity/source/xmlsec/nss/nssinitializer.cxx') diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx index 69e165c550fc..83a83a9ea551 100644 --- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx +++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx @@ -606,6 +606,7 @@ css::uno::Reference< css::xml::crypto::XCipherContext > SAL_CALL ONSSInitializer throw css::lang::IllegalArgumentException("Unexpected length of initialization vector.", css::uno::Reference< css::uno::XInterface >(), 3 ); xResult = OCipherContext::Create( nNSSCipherID, aKey, aInitializationVector, bEncryption, bW3CPadding ); + assert(xResult.is()); } return xResult; -- cgit