[git] GpgOL - branch, master, updated. gpgol-2.2.0-2-g3ba39a0
by Andre Heinecke
cvs at cvs.gnupg.org
Tue Jun 19 09:33:43 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 3ba39a0f442956ec4a6c8d0fa0e62fe696795980 (commit)
from 8e5fac3a1c74a4c863eae6b25b45b7c43e4c2421 (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 3ba39a0f442956ec4a6c8d0fa0e62fe696795980
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Tue Jun 19 09:29:11 2018 +0200
Fix crash when adding attachment without fileext
* src/mimemaker.cpp (infer_content_type): Check if a suffix
was found and check for the size of the suffix before using it.
--
The crash was introduced with 94c354a0
GnuPG-Bug-Id: T4032
diff --git a/src/mimemaker.cpp b/src/mimemaker.cpp
index d8d3684..e4bd4aa 100644
--- a/src/mimemaker.cpp
+++ b/src/mimemaker.cpp
@@ -679,10 +679,19 @@ infer_content_type (const char * /*data*/, size_t /*datalen*/,
*force_b64 = 0;
if (filename)
- suffix = strrchr (filename, '.');
+ {
+ const char *dot = strrchr (filename, '.');
+
+ if (dot)
+ {
+ suffix = dot;
+ }
+ }
- if (!suffix.empty())
+ /* Check for at least one char after the dot. */
+ if (suffix.size() > 1)
{
+ /* Erase the dot */
suffix.erase(0, 1);
std::transform(suffix.begin(), suffix.end(), suffix.begin(), ::tolower);
for (i=0; suffix_table[i].suffix; i++)
-----------------------------------------------------------------------
Summary of changes:
src/mimemaker.cpp | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
hooks/post-receive
--
GnuPG extension for MS Outlook
http://git.gnupg.org
More information about the Gnupg-commits
mailing list