diff options
author | Vincent Richard <[email protected]> | 2017-01-18 20:10:10 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2017-01-18 20:10:10 +0000 |
commit | ec5f4370b69de4ca4b8c5e3b3d2bc43e8fb4da7f (patch) | |
tree | 04c01bdebf76e708e8640aaad0c8ec1914181bdb /src | |
parent | Fixed possible bad memory access. (diff) | |
download | vmime-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.hpp | 15 |
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() << ">"); |