[git] GpgOL - branch, master, updated. gpgol-2.0.3-15-ge157554

by Andre Heinecke cvs at cvs.gnupg.org
Tue Nov 28 16:40:46 CET 2017


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  e15755431c209ad53b592db4e71e941e7b09f96d (commit)
       via  1d0660fa53d357247ac84545f9259244a1d9400c (commit)
      from  093da39ab37307e5b80dac4d58943f6a1518bb69 (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 e15755431c209ad53b592db4e71e941e7b09f96d
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Tue Nov 28 16:38:59 2017 +0100

    Fix sender fallbacks in update_oom_data
    
    * src/mail.cpp (Mail::update_oom_data): Fix sender fallbacks.
    
    --
    This fixes problems when the OOM returns objects but the
    values are unexpected / empty. In that case our fallbacks
    now properly pass through.
    
    GnuPG-Bug-Id: T3424

diff --git a/src/mail.cpp b/src/mail.cpp
index f8b0acf..5728052 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -1092,6 +1092,7 @@ Mail::update_oom_data ()
           char *senderMail = get_oom_string (m_mailitem, "SenderEmailAddress");
           if (senderMail)
             {
+              log_debug ("%s:%s Sender found", SRCNAME, __func__);
               m_sender = senderMail;
               xfree (senderMail);
               xfree (type);
@@ -1104,22 +1105,30 @@ Mail::update_oom_data ()
   if (sender)
     {
       char *buf = get_oom_string (sender, "SmtpAddress");
-      if (buf)
-        m_sender = buf;
-      xfree (buf);
       gpgol_release (sender);
-      return 0;
+      if (buf && strlen (buf))
+        {
+          log_debug ("%s:%s Sender fallback 1", SRCNAME, __func__);
+          m_sender = buf;
+          xfree (buf);
+          return 0;
+        }
+      xfree (buf);
     }
   /* Fallback to Sender object */
   sender = get_oom_object (m_mailitem, "Sender");
   if (sender)
     {
       char *buf = get_pa_string (sender, PR_SMTP_ADDRESS_DASL);
-      if (buf)
-        m_sender = buf;
-      xfree (buf);
       gpgol_release (sender);
-      return 0;
+      if (buf && strlen (buf))
+        {
+          log_debug ("%s:%s Sender fallback 2", SRCNAME, __func__);
+          m_sender = buf;
+          xfree (buf);
+          return 0;
+        }
+      xfree (buf);
     }
   /* We don't have s sender object or SendUsingAccount,
      well, in that case fall back to the current user. */
@@ -1127,11 +1136,15 @@ Mail::update_oom_data ()
   if (sender)
     {
       char *buf = get_pa_string (sender, PR_SMTP_ADDRESS_DASL);
-      if (buf)
-        m_sender = buf;
-      xfree (buf);
       gpgol_release (sender);
-      return 0;
+      if (buf && strlen (buf))
+        {
+          log_debug ("%s:%s Sender fallback 3", SRCNAME, __func__);
+          m_sender = buf;
+          xfree (buf);
+          return 0;
+        }
+      xfree (buf);
     }
 
   log_debug ("%s:%s: All fallbacks failed.",

commit 1d0660fa53d357247ac84545f9259244a1d9400c
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Tue Nov 28 16:35:15 2017 +0100

    Fix possible race bug of a crash observed
    
    * src/mail.cpp (Mail::close_all_mails): Check for valididy
    of mail object before closing.
    
    --
    I observed a deleted mail beeing closed and then it crashed.
    No idea how this could happen but this saveguard might help.

diff --git a/src/mail.cpp b/src/mail.cpp
index 20d9343..f8b0acf 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -1156,6 +1156,16 @@ Mail::close_all_mails ()
   std::map<LPDISPATCH, Mail *> mail_map_copy = g_mail_map;
   for (it = mail_map_copy.begin(); it != mail_map_copy.end(); ++it)
     {
+      /* XXX For non racy code the is_valid_ptr check should not
+         be necessary but we crashed sometimes closing a destroyed
+         mail. */
+      if (!is_valid_ptr (it->second))
+        {
+          log_debug ("%s:%s: Already deleted mail for %p",
+                   SRCNAME, __func__, it->first);
+          continue;
+        }
+
       if (!it->second->is_crypto_mail())
         {
           continue;
@@ -1382,7 +1392,8 @@ Mail::close (Mail *mail)
   int rc = invoke_oom_method_with_parms (mail->item(), "Close",
                                        NULL, &dispparams);
 
-  log_debug ("returned from invoke");
+  log_oom_extra ("%s:%s: Reurned from close",
+                 SRCNAME, __func__);
   return rc;
 }
 

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

Summary of changes:
 src/mail.cpp | 50 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 37 insertions(+), 13 deletions(-)


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




More information about the Gnupg-commits mailing list