diff options
author | ibanic <[email protected]> | 2021-05-15 20:32:24 +0000 |
---|---|---|
committer | ibanic <[email protected]> | 2021-05-15 20:32:24 +0000 |
commit | 5d78d879bb82d2466fe38ccaa3446fd74bf74b3b (patch) | |
tree | fa2c000b24841ed0735386ff8b82fcfb999b8d63 /src | |
parent | #261 Workaround for bad SEARCH response with AOL IMAP server (diff) | |
download | vmime-5d78d879bb82d2466fe38ccaa3446fd74bf74b3b.tar.gz vmime-5d78d879bb82d2466fe38ccaa3446fd74bf74b3b.zip |
Prevent accessing empty buffer
Diffstat (limited to 'src')
-rw-r--r-- | src/vmime/charsetConverter_icu.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vmime/charsetConverter_icu.cpp b/src/vmime/charsetConverter_icu.cpp index 56394797..faae7d32 100644 --- a/src/vmime/charsetConverter_icu.cpp +++ b/src/vmime/charsetConverter_icu.cpp @@ -433,6 +433,8 @@ 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 +522,8 @@ 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; |