diff options
-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; + } } } } |