svl/source/crypto/cryptosign.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1a92fc1f8fda6711fd34fd8dbfa04ddcf653992b
Author:     Juraj Šarinay <[email protected]>
AuthorDate: Sat Sep 27 15:24:27 2025 +0200
Commit:     Miklos Vajna <[email protected]>
CommitDate: Mon Sep 29 09:05:46 2025 +0200

    Fix two memory leaks in Signing::Sign() when timestamping signatures.
    
    Change-Id: I85dcfbb601b9cf86d00715201d1d91e40f9fd987
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191570
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins

diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx
index e2edcb29496d..1b9132fd6e0c 100644
--- a/svl/source/crypto/cryptosign.cxx
+++ b/svl/source/crypto/cryptosign.cxx
@@ -1079,7 +1079,7 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer)
 
         src.messageImprint.hashAlgorithm.algorithm.data = nullptr;
         src.messageImprint.hashAlgorithm.parameters.data = nullptr;
-        SECOID_SetAlgorithmID(nullptr, &src.messageImprint.hashAlgorithm, 
SEC_OID_SHA256, nullptr);
+        SECOID_SetAlgorithmID(arena, &src.messageImprint.hashAlgorithm, 
SEC_OID_SHA256, nullptr);
         src.messageImprint.hashedMessage = ts_digest;
 
         src.reqPolicy.type = siBuffer;
@@ -1215,7 +1215,7 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer)
         response_item.data = reinterpret_cast<unsigned 
char*>(const_cast<char*>(response_buffer.getStr()));
         response_item.len = response_buffer.getLength();
 
-        if (SEC_ASN1DecodeItem(nullptr, &response, TimeStampResp_Template, 
&response_item) != SECSuccess)
+        if (SEC_ASN1DecodeItem(arena, &response, TimeStampResp_Template, 
&response_item) != SECSuccess)
         {
             SAL_WARN("svl.crypto", "SEC_ASN1DecodeItem failed");
             return false;

Reply via email to