summaryrefslogtreecommitdiff
path: root/plugins/mmutf8fix
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2014-05-16 14:51:51 +0200
committerMichael Biebl <biebl@debian.org>2014-05-16 14:51:51 +0200
commitf1040389ccb2430b9ab2ba3209aa28a62565b721 (patch)
treec6bf609292b6f3a80754c2d01cc8855a36ac7a37 /plugins/mmutf8fix
parent9374a46543e9c43c009f80def8c3b2506b0b377e (diff)
downloadrsyslog-f1040389ccb2430b9ab2ba3209aa28a62565b721.tar.gz
Imported Upstream version 8.2.1upstream/8.2.1
Diffstat (limited to 'plugins/mmutf8fix')
-rw-r--r--plugins/mmutf8fix/mmutf8fix.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/mmutf8fix/mmutf8fix.c b/plugins/mmutf8fix/mmutf8fix.c
index 351bb12..e529686 100644
--- a/plugins/mmutf8fix/mmutf8fix.c
+++ b/plugins/mmutf8fix/mmutf8fix.c
@@ -254,9 +254,14 @@ doUTF8(instanceData *pData, uchar *msg, int lenMsg)
; /* nothing to do, all well */
} else if((c & 0xe0) == 0xc0) {
/* 2-byte sequence */
- strtIdx = i;
- seqLen = bytesLeft = 1;
- codepoint = c & 0x1f;
+ /* 0xc0 and 0xc1 are illegal */
+ if(c == 0xc0 || c == 0xc1) {
+ msg[i] = pData->replChar;
+ } else {
+ strtIdx = i;
+ seqLen = bytesLeft = 1;
+ codepoint = c & 0x1f;
+ }
} else if((c & 0xf0) == 0xe0) {
/* 3-byte sequence */
strtIdx = i;