Commit c76c4dd1 authored by Detlef Graef's avatar Detlef Graef
Browse files

Fix for GMime3 bug in message_add_signed_part()

parent 65a65486
Pipeline #315687 passed with stage
in 7 minutes and 55 seconds
......@@ -1749,11 +1749,15 @@ namespace pan
#ifdef HAVE_GMIME_30
GMimeObject *gmo;
gmo = g_mime_message_get_mime_part (body);
if (g_mime_multipart_signed_sign (gpg_ctx, gmo, uid.c_str(), &err) <0)
mps = g_mime_multipart_signed_sign (gpg_ctx, gmo, uid.c_str(), &err);
if (mps == NULL)
if (g_mime_multipart_signed_sign (mps, GMIME_OBJECT (part), gpg_ctx, uid.c_str(), GMIME_DIGEST_ALGO_SHA1, &err) <0)
#ifdef HAVE_GMIME_30
  • Well spotted. But I think gmo should be freed even if mps is not NULL: the gmo pointer is not returned so it must be freed in this function.

    I think it could be freed right after the call to g_mime_multipart_signed_sign

Please register or sign in to reply
return 0;
......@@ -1784,7 +1788,7 @@ namespace pan
#ifdef HAVE_GMIME_30
if (g_mime_multipart_encrypted_encrypt(gpg_ctx, GMIME_OBJECT (part), sign, uid.c_str(),
GMIME_ENCRYPT_NONE, rcp, &err) < 0)
Please register or sign in to reply
if (g_mime_multipart_encrypted_encrypt(mpe, GMIME_OBJECT (part), gpg_ctx, sign,
uid.c_str(), GMIME_DIGEST_ALGO_SHA1, rcp, &err) < 0)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment