From 23305f3df8bf4951476c5cd7b143fdd910cdbb08 Mon Sep 17 00:00:00 2001 From: Dmitry Isaikin Date: Tue, 26 Apr 2016 19:34:21 +0300 Subject: Handle case with parsing parts info with non-empty content name and empty non-null attachment filename. (#1407) BODYSTRUCTURE ((("text" "plain" ("charset" "utf-8") NIL NIL "base64" 58 1 NIL NIL NIL NIL)("text" "html" ("charset" "utf-8") NIL NIL "base64" 112 2 NIL NIL NIL NIL) "alternative" ("boundary" "--ALT--tVxePtRpLBZY6Hs0ao1c7BSGQcoQy5ur1460647449") NIL NIL NIL)("video" "quicktime" ("name" "=?UTF-8?B?Mi5tb3Y=?=") NIL NIL "base64" 3722950 NIL ("attachment" ("filename" "")) NIL NIL)("video" "quicktime" ("name" "=?UTF-8?B?MS5tb3Y=?=") NIL NIL "base64" 3941584 NIL ("attachment" ("filename" "")) NIL NIL)("video" "quicktime" ("name" "=?UTF-8?B?My5tb3Y=?=") NIL NIL "base64" 15571848 NIL ("attachment" ("filename" "")) NIL NIL) "mixed" ("boundary" "----tVxePtRpLBZY6Hs0ao1c7BSGQcoQy5ur-lcGxoWOFOYrZWofU-1460647449") NIL NIL NIL) --- src/core/abstract/MCAbstractPart.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/abstract/MCAbstractPart.cpp b/src/core/abstract/MCAbstractPart.cpp index 0956368c..93578808 100644 --- a/src/core/abstract/MCAbstractPart.cpp +++ b/src/core/abstract/MCAbstractPart.cpp @@ -260,7 +260,10 @@ void AbstractPart::importIMAPFields(struct mailimap_body_fields * fields, imap_param = (struct mailimap_single_body_fld_param *) clist_content(cur); if (strcasecmp(imap_param->pa_name, "filename") == 0) { - setFilename(String::stringByDecodingMIMEHeaderValue(imap_param->pa_value)); + String * filename = String::stringByDecodingMIMEHeaderValue(imap_param->pa_value); + if (filename != NULL && filename->length() > 0) { + setFilename(filename); + } } } } -- cgit v1.2.3