aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2017-01-18 20:10:10 +0000
committerVincent Richard <[email protected]>2017-01-18 20:10:10 +0000
commitec5f4370b69de4ca4b8c5e3b3d2bc43e8fb4da7f (patch)
tree04c01bdebf76e708e8640aaad0c8ec1914181bdb /src
parentFixed possible bad memory access. (diff)
downloadvmime-ec5f4370b69de4ca4b8c5e3b3d2bc43e8fb4da7f.tar.gz
vmime-ec5f4370b69de4ca4b8c5e3b3d2bc43e8fb4da7f.zip
Fixed #159: parsing error on invalid FETCH BODYSTRUCTURE response.
Diffstat (limited to 'src')
-rw-r--r--src/vmime/net/imap/IMAPParser.hpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/vmime/net/imap/IMAPParser.hpp b/src/vmime/net/imap/IMAPParser.hpp
index 448d6d6a..8b24c9ca 100644
--- a/src/vmime/net/imap/IMAPParser.hpp
+++ b/src/vmime/net/imap/IMAPParser.hpp
@@ -3324,7 +3324,20 @@ public:
}
VIMAP_PARSER_CHECK(SPACE);
- VIMAP_PARSER_GET(xstring, m_string2);
+
+ if (!parser.isStrict())
+ {
+ // In non-strict mode, allow NIL in value
+ shared_ptr <nstring> nstr;
+ VIMAP_PARSER_GET_PTR(nstring, nstr);
+
+ m_string2 = new xstring();
+ m_string2->setValue(nstr->value());
+ }
+ else
+ {
+ VIMAP_PARSER_GET(xstring, m_string2);
+ }
DEBUG_FOUND("body_fld_param_item", "<" << m_string1->value() << ", " << m_string2->value() << ">");