vcl/source/filter/ipdf/pdfdocument.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 89ae3faf6e215853c1320303bf050a191ed1c021
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Wed Feb 25 09:19:49 2026 +0100
Commit:     Stephan Bergmann <[email protected]>
CommitDate: Wed Feb 25 13:20:07 2026 +0100

    Revert "Fix heap-use-after-free"
    
    This reverts commit 15995c4d464505f6d4e6725901f7678795ec6f74, which was
    obsoleted by
    
<https://git.libreoffice.org/core/+/fa002b6244207ff2bb92f7e714d56c4e2b103064%5E%21>
    "fix asan heap-use-after-free".
    
    Change-Id: I852a5a3bc6ce0b254b2761c19767d78c9cc94ed0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200286
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>

diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx 
b/vcl/source/filter/ipdf/pdfdocument.cxx
index bbb9b84ea5bc..bce5265de69e 100644
--- a/vcl/source/filter/ipdf/pdfdocument.cxx
+++ b/vcl/source/filter/ipdf/pdfdocument.cxx
@@ -574,10 +574,9 @@ bool PDFDocument::WriteCatalogObject(sal_Int32 nAnnotId, 
PDFReferenceElement*& p
         if (!pAcroFormDictionary)
         {
             // No AcroForm key, assume no signatures.
-            auto const p = static_cast<const char*>(m_aEditBuffer.GetData())
-                           + pCatalog->GetDictionaryOffset();
-            std::vector<char> copy(p, p + pCatalog->GetDictionaryLength());
-            m_aEditBuffer.WriteBytes(copy.data(), copy.size());
+            m_aEditBuffer.WriteBytes(static_cast<const 
char*>(m_aEditBuffer.GetData())
+                                         + pCatalog->GetDictionaryOffset(),
+                                     pCatalog->GetDictionaryLength());
             m_aEditBuffer.WriteOString("/AcroForm<</Fields[
");
             m_aEditBuffer.WriteNumberAsString(nAnnotId);
             m_aEditBuffer.WriteOString(" 0 R
]/SigFlags 3>>
");

Reply via email to