diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-10-10 14:44:17 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-10-10 14:44:17 +0200 |
commit | 97bda43e372a506671cb7007b6041e4160a02b04 (patch) | |
tree | c4b25e4b124518f5e264115bd404b241c6d9f1da | |
parent | 8becda672bf91fd4a4d25fc74d5f44162eec4fff (diff) | |
download | rsyslog-97bda43e372a506671cb7007b6041e4160a02b04.tar.gz rsyslog-97bda43e372a506671cb7007b6041e4160a02b04.tar.bz2 rsyslog-97bda43e372a506671cb7007b6041e4160a02b04.zip |
bugfix: mmutf8fix did not properly handle invalid UTF-8 at END of message
if the very last character sequence was too long, this was not detected
Thanks to Risto Vaarandi for reporting this problem.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | plugins/mmutf8fix/mmutf8fix.c | 5 |
2 files changed, 8 insertions, 0 deletions
@@ -2,6 +2,9 @@ Version 7.5.5 [devel] 2013-10-?? - imudp: add "dfltTZ" input config parameter - bugfix: memory leak in mmnormalize +- bugfix: mmutf8fix did not properly handle invalid UTF-8 at END of message + if the very last character sequence was too long, this was not detected + Thanks to Risto Vaarandi for reporting this problem. --------------------------------------------------------------------------- Version 7.5.4 [devel] 2013-10-07 - mmpstrucdata: new module to parse RFC5424 structured data into json diff --git a/plugins/mmutf8fix/mmutf8fix.c b/plugins/mmutf8fix/mmutf8fix.c index 41d98653..f49e79fa 100644 --- a/plugins/mmutf8fix/mmutf8fix.c +++ b/plugins/mmutf8fix/mmutf8fix.c @@ -256,6 +256,11 @@ doUTF8(instanceData *pData, uchar *msg, int lenMsg) } else { /* invalid (5&6 byte forbidden by RFC3629) */ msg[i] = pData->replChar; } + if(i+bytesleft >= lenMsg) { + /* invalid, as rest of message cannot contain full char */ + fixInvldMBSeq(pData, msg, lenMsg, strtIdx, lenMsg, seqLen); + i = lenMsg - 1; + } } } } |