[git] GpgOL - branch, master, updated. gpgol-1.4.0-172-g8ffd2b6

by Andre Heinecke cvs at cvs.gnupg.org
Tue Nov 15 15:18:36 CET 2016


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  8ffd2b6369cde93b75bad8adf8dcd89911862546 (commit)
       via  4cb8d9a2cb25981c60840b9e1d449bc6a575ace4 (commit)
       via  9fafa5c667742310cf65f0edd4b1d0ae881bb7a9 (commit)
       via  65d223f4960a560632ce04c4563589181171a496 (commit)
      from  e4ed7ecb3f153450599b53fcc42906839a57717b (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 8ffd2b6369cde93b75bad8adf8dcd89911862546
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Tue Nov 15 15:16:59 2016 +0100

    Use undecoded body if charset unkown or not found
    
    * src/mlang-charset.cpp (ansi_charset_to_utf8): Handle no charset.

diff --git a/src/mlang-charset.cpp b/src/mlang-charset.cpp
index 0e60492..016fb61 100644
--- a/src/mlang-charset.cpp
+++ b/src/mlang-charset.cpp
@@ -43,6 +43,13 @@ char *ansi_charset_to_utf8 (const char *charset, const char *input,
   wchar_t *buf;
   char *ret;
 
+  if (!charset || !strlen (charset))
+    {
+      log_debug ("%s:%s: No charset returning plain.",
+                 SRCNAME, __func__);
+      return strdup (input);
+    }
+
   CoCreateInstance(CLSID_CMultiLanguage, NULL, CLSCTX_INPROC_SERVER,
                    IID_IMultiLanguage, (void**)&multilang);
 
@@ -73,7 +80,7 @@ char *ansi_charset_to_utf8 (const char *charset, const char *input,
       log_error ("%s:%s: Failed to find charset for: %s",
                  SRCNAME, __func__, charset);
       gpgol_release (multilang);
-      return NULL;
+      return strdup(input);
     }
   enc = (mime_info.uiInternetEncoding == 0) ? mime_info.uiCodePage :
                                               mime_info.uiInternetEncoding;

commit 4cb8d9a2cb25981c60840b9e1d449bc6a575ace4
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Tue Nov 15 15:16:18 2016 +0100

    Add some more error messages to finalize_message
    
    * src/mimemaker.cpp (finalize_message): Add some more errors.

diff --git a/src/mimemaker.cpp b/src/mimemaker.cpp
index 51c555b..a9e9aa6 100644
--- a/src/mimemaker.cpp
+++ b/src/mimemaker.cpp
@@ -1120,7 +1120,11 @@ finalize_message (LPMESSAGE message, mapi_attach_item_t *att_table,
   /* Set a special property so that we are later able to identify
      messages signed or encrypted by us.  */
   if (mapi_set_sig_status (message, "@"))
-    return -1;
+    {
+      log_error ("%s:%s: error setting sigstatus",
+                 SRCNAME, __func__);
+      return -1;
+    }
 
   /* We also need to set the message class into our custom
      property. This override is at least required for encrypted
@@ -1131,18 +1135,32 @@ finalize_message (LPMESSAGE message, mapi_attach_item_t *att_table,
                                   "IPM.Note.GpgOL.OpaqueEncrypted" :
                                   "IPM.Note.GpgOL.MultipartEncrypted") :
                                  "IPM.Note.GpgOL.MultipartSigned")))
-    return -1;
+    {
+      log_error ("%s:%s: error setting gpgol msgclass",
+                 SRCNAME, __func__);
+      return -1;
+    }
 
   /* Now delete all parts of the MAPI message except for the one
      attachment we just created.  */
   if (delete_all_attachments (message, att_table))
-    return -1;
+    {
+      log_error ("%s:%s: error deleting attachments",
+                 SRCNAME, __func__);
+      return -1;
+    }
 
   /* Remove the draft info so that we don't leak the information on
      whether the message has been signed etc.  */
   mapi_set_gpgol_draft_info (message, NULL);
 
-  return mapi_save_changes (message, KEEP_OPEN_READWRITE|FORCE_SAVE);
+  if (mapi_save_changes (message, KEEP_OPEN_READWRITE|FORCE_SAVE))
+    {
+      log_error ("%s:%s: error saving changes.",
+                 SRCNAME, __func__);
+      return -1;
+    }
+  return 0;
 }
 
 

commit 9fafa5c667742310cf65f0edd4b1d0ae881bb7a9
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Tue Nov 15 15:15:14 2016 +0100

    Fix use after free in mimemaker
    
    * src/mimemaker.cpp (create_mapi_attachment),
    (finalize_message): Do not use GpgOLStr for assignments.

diff --git a/src/mimemaker.cpp b/src/mimemaker.cpp
index edb9980..51c555b 100644
--- a/src/mimemaker.cpp
+++ b/src/mimemaker.cpp
@@ -186,8 +186,9 @@ create_mapi_attachment (LPMESSAGE message, sink_t sink)
 
   /* We better insert a short filename. */
   prop.ulPropTag = PR_ATTACH_FILENAME_A;
-  prop.Value.lpszA = GpgOLStr (MIMEATTACHFILENAME);
+  prop.Value.lpszA = strdup (MIMEATTACHFILENAME);
   hr = HrSetOneProp ((LPMAPIPROP)att, &prop);
+  xfree (prop.Value.lpszA);
   if (hr)
     {
       log_error ("%s:%s: can't set attach filename: hr=%#lx\n",
@@ -1100,13 +1101,15 @@ finalize_message (LPMESSAGE message, mapi_attach_item_t *att_table,
   prop.ulPropTag = PR_MESSAGE_CLASS_A;
   if (encrypt)
     {
-      prop.Value.lpszA = GpgOLStr ("IPM.Note.InfoPathForm.GpgOL.SMIME.MultipartSigned");
+      prop.Value.lpszA = strdup ("IPM.Note.InfoPathForm.GpgOL.SMIME.MultipartSigned");
     }
   else
     {
-      prop.Value.lpszA = GpgOLStr ("IPM.Note.InfoPathForm.GpgOLS.SMIME.MultipartSigned");
+      prop.Value.lpszA = strdup ("IPM.Note.InfoPathForm.GpgOLS.SMIME.MultipartSigned");
     }
+
   hr = message->SetProps(1, &prop, NULL);
+  xfree(prop.Value.lpszA);
   if (hr)
     {
       log_error ("%s:%s: error setting the message class: hr=%#lx\n",

commit 65d223f4960a560632ce04c4563589181171a496
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Tue Nov 15 15:12:54 2016 +0100

    Fix use after free & double free
    
    * src/mail.cpp (Mail::get_signature_status): Do not append / free
    buf as it is no longer set in the above block.

diff --git a/src/mail.cpp b/src/mail.cpp
index ee864e3..8c5c478 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -1465,8 +1465,6 @@ Mail::get_signature_status()
       message +=  isOpenPGP ? _("Click here to search the key on the configured keyserver.") :
                               _("Click here to search the certificate on the configured X509 keyserver.");
     }
-  message += buf;
-  xfree (buf);
   return message;
 }
 

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

Summary of changes:
 src/mail.cpp          |  2 --
 src/mimemaker.cpp     | 35 ++++++++++++++++++++++++++++-------
 src/mlang-charset.cpp |  9 ++++++++-
 3 files changed, 36 insertions(+), 10 deletions(-)


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




More information about the Gnupg-commits mailing list