[poppler] glib/poppler-form-field.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 23 09:38:49 UTC 2023


 glib/poppler-form-field.cc |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3d38bd6abacc607e492361f8febf381065913d36
Author: Sune Vuorela <sune at vuorela.dk>
Date:   Thu Mar 23 09:38:47 2023 +0000

    Fix use of dangling memory
    
    g_strdup is a macro and thus the intermediate getSignerName() value would be destructed after the first line of code in the macro

diff --git a/glib/poppler-form-field.cc b/glib/poppler-form-field.cc
index 41c74848..5ff189a0 100644
--- a/glib/poppler-form-field.cc
+++ b/glib/poppler-form-field.cc
@@ -469,7 +469,8 @@ static PopplerSignatureInfo *_poppler_form_field_signature_validate(PopplerFormF
         break;
     }
 
-    poppler_sig_info->signer_name = g_strdup(sig_info->getSignerName().c_str());
+    std::string signerName = sig_info->getSignerName();
+    poppler_sig_info->signer_name = g_strdup(signerName.c_str());
     poppler_sig_info->local_signing_time = g_date_time_new_from_unix_local(sig_info->getSigningTime());
 
     return poppler_sig_info;


More information about the poppler mailing list