aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2019-04-18 09:28:48 +0000
committerVincent Richard <[email protected]>2019-04-18 09:28:48 +0000
commitb59e97d0a7cf97ed68a0071cd3e90ecfe0c04cc5 (patch)
treec334d9adf0ba593d49250f8b986675f9cd5c5433 /src
parent#206 Initialize and delete pointers (diff)
downloadvmime-b59e97d0a7cf97ed68a0071cd3e90ecfe0c04cc5.tar.gz
vmime-b59e97d0a7cf97ed68a0071cd3e90ecfe0c04cc5.zip
#213 Add support for invalid empty () in FETCH body structure (non-strict)
Diffstat (limited to 'src')
-rw-r--r--src/vmime/net/imap/IMAPParser.hpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/vmime/net/imap/IMAPParser.hpp b/src/vmime/net/imap/IMAPParser.hpp
index 186ac23f..70781eae 100644
--- a/src/vmime/net/imap/IMAPParser.hpp
+++ b/src/vmime/net/imap/IMAPParser.hpp
@@ -3398,11 +3398,24 @@ public:
if (VIMAP_PARSER_TRY_CHECK(one_char <'('> )) {
- VIMAP_PARSER_GET_PUSHBACK(body_fld_param_item, m_items);
+ bool isNIL = false;
+
+ if (!parser.isStrict()) {
+
+ // In non-strict mode, allow "()" instead of "NIL"
+ if (VIMAP_PARSER_TRY_CHECK(one_char <')'> )) {
+ isNIL = true;
+ }
+ }
+
+ if (!isNIL) {
- while (!VIMAP_PARSER_TRY_CHECK(one_char <')'> )) {
- VIMAP_PARSER_CHECK(SPACE);
VIMAP_PARSER_GET_PUSHBACK(body_fld_param_item, m_items);
+
+ while (!VIMAP_PARSER_TRY_CHECK(one_char <')'> )) {
+ VIMAP_PARSER_CHECK(SPACE);
+ VIMAP_PARSER_GET_PUSHBACK(body_fld_param_item, m_items);
+ }
}
} else {