[git] GpgOL - branch, master, updated. gpgol-2.0.3-9-g469a814
by Andre Heinecke
cvs at cvs.gnupg.org
Mon Nov 27 13:54:54 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 469a81471800d49401c9d3b4657c1ae8a7e8c7f6 (commit)
from c96f484c79a57b7e2f5dd3aecae71dae198c0467 (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 469a81471800d49401c9d3b4657c1ae8a7e8c7f6
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Mon Nov 27 13:53:28 2017 +0100
Add checks to avoid assigning NULL to std::string
* src/mail.cpp (Mail::update_oom_data): Safeguard against
NULL assignment to std::string.
--
Not sure if this really leads to a crash but it's undefined
so it should not be done.
GnuPG-Bug-Id: T3540
diff --git a/src/mail.cpp b/src/mail.cpp
index 00b6a3d..60c4265 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -1039,8 +1039,15 @@ Mail::update_oom_data ()
/* Store the body. It was not obvious for me (aheinecke) how
to access this through MAPI. */
- m_html_body = get_oom_string (m_mailitem, "HTMLBody");
-
+ if (m_is_html_alternative)
+ {
+ log_debug ("%s:%s: Is html alternative mail.", SRCNAME, __func__);
+ const char * html_body = get_oom_string (m_mailitem, "HTMLBody")
+ if (html_body)
+ {
+ m_html_body = html_body;
+ }
+ }
/* For some reason outlook may store the recipient address
in the send using account field. If we have SMTP we prefer
the SenderEmailAddress string. */
@@ -1070,7 +1077,8 @@ Mail::update_oom_data ()
if (sender)
{
char *buf = get_oom_string (sender, "SmtpAddress");
- m_sender = buf;
+ if (buf)
+ m_sender = buf;
xfree (buf);
gpgol_release (sender);
return 0;
@@ -1080,7 +1088,8 @@ Mail::update_oom_data ()
if (sender)
{
char *buf = get_pa_string (sender, PR_SMTP_ADDRESS_DASL);
- m_sender = buf;
+ if (buf)
+ m_sender = buf;
xfree (buf);
gpgol_release (sender);
return 0;
@@ -1091,7 +1100,8 @@ Mail::update_oom_data ()
if (sender)
{
char *buf = get_pa_string (sender, PR_SMTP_ADDRESS_DASL);
- m_sender = buf;
+ if (buf)
+ m_sender = buf;
xfree (buf);
gpgol_release (sender);
return 0;
-----------------------------------------------------------------------
Summary of changes:
src/mail.cpp | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
hooks/post-receive
--
GnuPG extension for MS Outlook
http://git.gnupg.org
More information about the Gnupg-commits
mailing list