[git] GpgOL - branch, master, updated. gpgol-2.0.4-4-g3dedccb

by Andre Heinecke cvs at cvs.gnupg.org
Fri Dec 8 06:49:50 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  3dedccb4d51397fb73014d17b3699fae78f1df06 (commit)
       via  73b216ff3108bb40f57765747c829a8a9d354cb5 (commit)
       via  83896673f9a5747237f5dde5f1251998c85481d0 (commit)
      from  dd57c3dc02d92fd58003febd860e0627bb24f356 (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 3dedccb4d51397fb73014d17b3699fae78f1df06
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Dec 8 06:49:30 2017 +0100

    Minor cleanup
    
    --

diff --git a/src/mail.cpp b/src/mail.cpp
index bb3f030..dd58f6d 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -636,7 +636,7 @@ add_attachments(LPDISPATCH mail,
         }
       wchar_t* wchar_name = utf8_to_wchar (att->get_display_name().c_str());
       HANDLE hFile;
-      wchar_t* wchar_file = get_tmp_outfile (GpgOLStr (att->get_display_name().c_str()),
+      wchar_t* wchar_file = get_tmp_outfile (wchar_name,
                                              &hFile);
       if (copy_attachment_to_file (att, hFile))
         {
@@ -1471,7 +1471,7 @@ Mail::close (Mail *mail)
   int rc = invoke_oom_method_with_parms (mail->item(), "Close",
                                        NULL, &dispparams);
 
-  log_oom_extra ("%s:%s: Reurned from close",
+  log_oom_extra ("%s:%s: Returned from close",
                  SRCNAME, __func__);
   return rc;
 }

commit 73b216ff3108bb40f57765747c829a8a9d354cb5
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Dec 8 06:48:48 2017 +0100

    Fix minor memleaks
    
    * src/mail.cpp (Mail::close_inspector): Release inspector.
    (Mail::check_attachments): Don't leak DisplayName.

diff --git a/src/mail.cpp b/src/mail.cpp
index 78acd9c..bb3f030 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -377,7 +377,9 @@ Mail::check_attachments () const
           (var.vt == VT_BOOL && var.boolVal == VARIANT_FALSE))
         {
           foundOne = true;
-          message += get_oom_string (oom_attach, "DisplayName");
+          char *dispName = get_oom_string (oom_attach, "DisplayName");
+          message += dispName ? dispName : "Unknown";
+          xfree (dispName);
           message += "\n";
         }
       VariantClear (&var);
@@ -1442,9 +1444,11 @@ Mail::close_inspector (Mail *mail)
         {
           log_debug ("%s:%s: Failed to close inspector: %#lx",
                      SRCNAME, __func__, hr);
+          gpgol_release (inspector);
           return -1;
         }
     }
+  gpgol_release (inspector);
   return 0;
 }
 

commit 83896673f9a5747237f5dde5f1251998c85481d0
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Dec 8 06:46:54 2017 +0100

    Fix handling of attachments without extension
    
    * src/common.c (get_tmp_outfile): Handle the case that
    fileext is NULL.
    
    --
    This fixes a crash for attachments without a file
    extension.
    
    GnuPG-Bug-ID: T3582

diff --git a/src/common.c b/src/common.c
index 98cb264..f2bfc86 100644
--- a/src/common.c
+++ b/src/common.c
@@ -756,7 +756,6 @@ get_tmp_outfile (wchar_t *name, HANDLE *outHandle)
   memset (outName, 0, (MAX_PATH + 1) * sizeof (wchar_t));
 
   snwprintf (outName, MAX_PATH, L"%s%s", tmpPath, name);
-  fileExt = wcschr (wcschr(outName, '\\'), '.');
 
   while ((*outHandle = CreateFileW (outName,
                                     GENERIC_WRITE | GENERIC_READ,
@@ -773,8 +772,16 @@ get_tmp_outfile (wchar_t *name, HANDLE *outHandle)
 
       snwprintf (origName, MAX_PATH, L"%s%s", tmpPath, name);
       fileExt = wcschr (wcsrchr(origName, '\\'), '.');
-      wcsncpy (fnameBuf, origName, fileExt - origName);
-      snwprintf (outName, MAX_PATH, L"%s%i%s", fnameBuf, tries++, fileExt);
+      if (fileExt)
+        {
+          wcsncpy (fnameBuf, origName, fileExt - origName);
+        }
+      else
+        {
+          wcsncpy (fnameBuf, origName, wcslen (origName));
+        }
+      snwprintf (outName, MAX_PATH, L"%s%i%s", fnameBuf, tries++,
+                 fileExt ? fileExt : L"");
       if (tries > 100)
         {
           /* You have to know when to give up,.. */

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

Summary of changes:
 src/common.c | 13 ++++++++++---
 src/mail.cpp | 10 +++++++---
 2 files changed, 17 insertions(+), 6 deletions(-)


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




More information about the Gnupg-commits mailing list