[git] GpgOL - branch, master, updated. gpgol-2.0.5-7-gdf029bc

by Andre Heinecke cvs at cvs.gnupg.org
Mon Jan 8 11:26:33 CET 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  df029bca0eecd11f78bd0ef95360d0f37cb4b9d5 (commit)
       via  f892c4d19cf7c1b3d885fdbcc417fba380b3d363 (commit)
       via  ef015c7a53fedb004ff0c049add887def231957b (commit)
      from  b8276a4f3acecee2e467c0530007aedc9db5936a (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 df029bca0eecd11f78bd0ef95360d0f37cb4b9d5
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Jan 8 11:21:29 2018 +0100

    Fix return type for mails with override msgcls
    
    * src/mapihelp.cpp (mapi_change_message_class): Improve logging
    in override case.
    (mapi_change_message_class): Ensure r_type is set correctly.
    
    --
    This fixes some cases where the message class was already set.
    Apparently this happens on Exchange / Exchange Online as I
    was only able to reproduce the problem there. It might happen
    in other set ups where the server already stores our GpgOL
    message class.
    
    GnuPG-Bug-Id: T3537

diff --git a/src/mapihelp.cpp b/src/mapihelp.cpp
index 952ddd6..a9c69c3 100644
--- a/src/mapihelp.cpp
+++ b/src/mapihelp.cpp
@@ -1378,9 +1378,30 @@ mapi_change_message_class (LPMESSAGE message, int sync_override,
 
           hr = HrGetOneProp ((LPMAPIPROP)message, PR_MESSAGE_CLASS_A,
                              &propval2);
-          if (SUCCEEDED (hr) && PROP_TYPE (propval2->ulPropTag) == PT_STRING8
-              && propval2->Value.lpszA && strcmp (propval2->Value.lpszA, s))
-            newvalue = (char*)xstrdup (s);
+          if (!SUCCEEDED (hr))
+            {
+              log_debug ("%s:%s: Failed to get PR_MESSAGE_CLASS_A property.",
+                         SRCNAME, __func__);
+            }
+          else if (PROP_TYPE (propval2->ulPropTag) != PT_STRING8)
+            {
+              log_debug ("%s:%s: PR_MESSAGE_CLASS_A is not string.",
+                         SRCNAME, __func__);
+            }
+          else if (!propval2->Value.lpszA)
+            {
+              log_debug ("%s:%s: PR_MESSAGE_CLASS_A is null.",
+                         SRCNAME, __func__);
+            }
+          else if (!strcmp (propval2->Value.lpszA, s))
+            {
+              log_debug ("%s:%s: PR_MESSAGE_CLASS_A is already the same.",
+                         SRCNAME, __func__);
+            }
+          else
+            {
+              newvalue = (char*)xstrdup (s);
+            }
           MAPIFreeBuffer (propval2);
         }
       else if (opt.enable_smime 
@@ -1390,7 +1411,7 @@ mapi_change_message_class (LPMESSAGE message, int sync_override,
           newvalue = change_message_class_ipm_note_secure_cex
             (message, cexenc);
         }
-      else if (r_type)
+      if (r_type && !newvalue)
         {
           *r_type = string_to_type (s);
         }
@@ -1408,7 +1429,7 @@ mapi_change_message_class (LPMESSAGE message, int sync_override,
     }
   else
     {
-      if (r_type && newvalue)
+      if (r_type)
         {
           *r_type = string_to_type (newvalue);
         }

commit f892c4d19cf7c1b3d885fdbcc417fba380b3d363
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Jan 8 11:19:38 2018 +0100

    Improve some debug outputs
    
    * src/mail.cpp(Mail::pre_process_message): Log item ptr.
    (Mail::decrypt_verify): Log on bailout for non crypto mail.
    * src/mailitem-events.cpp (EVENT_SINK_INVOKE(MailItemEvents)):
    Log on bailout for non crypto mail.

diff --git a/src/mail.cpp b/src/mail.cpp
index e0f988a..114e65c 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -256,8 +256,8 @@ Mail::pre_process_message ()
                  SRCNAME, __func__);
       return 0;
     }
-  log_oom_extra ("%s:%s: GetBaseMessage OK.",
-                 SRCNAME, __func__);
+  log_oom_extra ("%s:%s: GetBaseMessage OK for %p.",
+                 SRCNAME, __func__, m_mailitem);
   /* Change the message class here. It is important that
      we change the message class in the before read event
      regardless if it is already set to one of GpgOL's message
@@ -739,6 +739,8 @@ Mail::decrypt_verify()
 {
   if (!is_crypto_mail())
     {
+      log_debug ("%s:%s: Decrypt Verify for non crypto mail: %p.",
+                 SRCNAME, __func__, m_mailitem);
       return 0;
     }
   if (m_needs_wipe)
diff --git a/src/mailitem-events.cpp b/src/mailitem-events.cpp
index e45299d..ae4aa66 100644
--- a/src/mailitem-events.cpp
+++ b/src/mailitem-events.cpp
@@ -189,6 +189,8 @@ EVENT_SINK_INVOKE(MailItemEvents)
                          SRCNAME, __func__, m_mail);
           if (!m_mail->is_crypto_mail())
             {
+              log_debug ("%s:%s: Non crypto mail %p opened. Updating sigstatus.",
+                         SRCNAME, __func__, m_mail);
               /* Ensure that no wrong sigstatus is shown */
               CloseHandle(CreateThread (NULL, 0, delayed_invalidate_ui, (LPVOID) this, 0,
                                         NULL));

commit ef015c7a53fedb004ff0c049add887def231957b
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Jan 8 09:27:57 2018 +0100

    Fix memleak in mail object
    
    * src/mail.cpp (Mail::~Mail): Free cached body information.

diff --git a/src/mail.cpp b/src/mail.cpp
index 266a428..e0f988a 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -197,6 +197,8 @@ Mail::~Mail()
       log_oom_extra ("%s:%s: non crypto mail: %p destroyed",
                      SRCNAME, __func__, this);
     }
+  xfree (m_cached_html_body);
+  xfree (m_cached_plain_body);
   gpgrt_lock_unlock (&dtor_lock);
 }
 

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

Summary of changes:
 src/mail.cpp            |  8 ++++++--
 src/mailitem-events.cpp |  2 ++
 src/mapihelp.cpp        | 31 ++++++++++++++++++++++++++-----
 3 files changed, 34 insertions(+), 7 deletions(-)


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




More information about the Gnupg-commits mailing list