[git] GpgOL - branch, master, updated. gpgol-2.2.0-117-g333f175

by Andre Heinecke cvs at cvs.gnupg.org
Mon Jul 23 16:33:23 CEST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".

The branch, master has been updated
       via  333f17572f1e414eb5a41d477d5187e12f3307bf (commit)
       via  d4c0e8caf3ea75f56b7ccad49084324ab4741afa (commit)
      from  43cd17881983b02d90062bca8050f07c97fe325f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 333f17572f1e414eb5a41d477d5187e12f3307bf
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Jul 23 16:32:32 2018 +0200

    Fix orig body memleak in decryptVerify
    
    * src/mail.cpp (Mail::decryptVerify_o): Don't assign
    heap alloced data to std::string without free.

diff --git a/src/mail.cpp b/src/mail.cpp
index afad308..27fba3f 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -1022,7 +1022,14 @@ Mail::decryptVerify_o ()
 
   if (opt.prefer_html)
     {
-      m_orig_body = get_oom_string (m_mailitem, "HTMLBody");
+      char *tmp = get_oom_string (m_mailitem, "HTMLBody");
+      if (!tmp)
+        {
+          TRACEPOINT;
+          return 1;
+        }
+      m_orig_body = tmp;
+      xfree (tmp);
       if (put_oom_string (m_mailitem, "HTMLBody", placeholder_buf))
         {
           log_error ("%s:%s: Failed to modify html body of item.",
@@ -1031,7 +1038,14 @@ Mail::decryptVerify_o ()
     }
   else
     {
-      m_orig_body = get_oom_string (m_mailitem, "Body");
+      char *tmp = get_oom_string (m_mailitem, "Body");
+      if (!tmp)
+        {
+          TRACEPOINT;
+          return 1;
+        }
+      m_orig_body = tmp;
+      xfree (tmp);
       if (put_oom_string (m_mailitem, "Body", placeholder_buf))
         {
           log_error ("%s:%s: Failed to modify body of item.",

commit d4c0e8caf3ea75f56b7ccad49084324ab4741afa
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Jul 23 16:31:45 2018 +0200

    Fix memleak of plain body in collect_data
    
    * src/cryptcontroller.cpp (CryptController::collect_data): Fix
    leak.

diff --git a/src/cryptcontroller.cpp b/src/cryptcontroller.cpp
index d97e891..826dde4 100644
--- a/src/cryptcontroller.cpp
+++ b/src/cryptcontroller.cpp
@@ -153,8 +153,11 @@ CryptController::collect_data ()
   sink->writefnc = sink_data_write;
 
   /* Collect the mime strucutre */
-  if (add_body_and_attachments (sink, message, att_table, m_mail,
-                                body, n_att_usable))
+  int err = add_body_and_attachments (sink, message, att_table, m_mail,
+                                      body, n_att_usable);
+  xfree (body);
+
+  if (err)
     {
       log_error ("%s:%s: Collecting body and attachments failed.",
                  SRCNAME, __func__);

-----------------------------------------------------------------------

Summary of changes:
 src/cryptcontroller.cpp |  7 +++++--
 src/mail.cpp            | 18 ++++++++++++++++--
 2 files changed, 21 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GnuPG extension for MS Outlook
http://git.gnupg.org




More information about the Gnupg-commits mailing list