mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 12:28:09 +01:00
mime-node: handle decrypt_result more safely
If (for whatever reason) we don't get a decrypt_result back, or it's not structured the way we expect it to be, we shouldn't choke on it.
This commit is contained in:
parent
842d7dffcb
commit
9beda4b981
1 changed files with 8 additions and 6 deletions
|
@ -214,6 +214,7 @@ node_decrypt_and_verify (mime_node_t *node, GMimeObject *part,
|
||||||
node->decrypt_success = true;
|
node->decrypt_success = true;
|
||||||
node->verify_attempted = true;
|
node->verify_attempted = true;
|
||||||
|
|
||||||
|
if (decrypt_result) {
|
||||||
/* This may be NULL if the part is not signed. */
|
/* This may be NULL if the part is not signed. */
|
||||||
node->sig_list = g_mime_decrypt_result_get_signatures (decrypt_result);
|
node->sig_list = g_mime_decrypt_result_get_signatures (decrypt_result);
|
||||||
if (node->sig_list) {
|
if (node->sig_list) {
|
||||||
|
@ -221,6 +222,7 @@ node_decrypt_and_verify (mime_node_t *node, GMimeObject *part,
|
||||||
set_signature_list_destructor (node);
|
set_signature_list_destructor (node);
|
||||||
}
|
}
|
||||||
g_object_unref (decrypt_result);
|
g_object_unref (decrypt_result);
|
||||||
|
}
|
||||||
|
|
||||||
DONE:
|
DONE:
|
||||||
if (err)
|
if (err)
|
||||||
|
|
Loading…
Reference in a new issue