diff options
author | Vincent Richard <[email protected]> | 2021-05-16 16:43:14 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-16 16:43:14 +0000 |
commit | edcb4b4b1f1feb5d823d2eaba6aa6dda462d0b00 (patch) | |
tree | 502687efd998471775e27b78d41aee4f979289ee /src | |
parent | #261 Workaround for bad SEARCH response with AOL IMAP server (diff) | |
parent | fixed coding style (diff) | |
download | vmime-edcb4b4b1f1feb5d823d2eaba6aa6dda462d0b00.tar.gz vmime-edcb4b4b1f1feb5d823d2eaba6aa6dda462d0b00.zip |
Merge pull request #262 from ibanic/master
Prevent accessing empty buffer when using FilteredOutputStream with ICU
Diffstat (limited to 'src')
-rw-r--r-- | src/vmime/charsetConverter_icu.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vmime/charsetConverter_icu.cpp b/src/vmime/charsetConverter_icu.cpp index 56394797..5016dca8 100644 --- a/src/vmime/charsetConverter_icu.cpp +++ b/src/vmime/charsetConverter_icu.cpp @@ -433,6 +433,9 @@ void charsetFilteredOutputStream_icu::writeImpl( } const size_t uniLength = uniTarget - &uniBuffer[0]; + if(uniLength == 0) { + continue; + } // Allocate buffer for destination charset const size_t cpSize = ucnv_getMinCharSize(m_to) * uniLength; @@ -520,6 +523,9 @@ void charsetFilteredOutputStream_icu::flush() { } const size_t uniLength = uniTarget - &uniBuffer[0]; + if(uniLength == 0) { + continue; + } // Allocate buffer for destination charset const size_t cpSize = ucnv_getMinCharSize(m_to) * uniLength; |