From: Karl Waclawek Date: Tue, 27 Aug 2002 00:28:48 +0000 (+0000) Subject: Fix for bug #600479: error decoding UTF-8 triplet X-Git-Tag: R_1_95_5~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=969d3363fe2ab8c983bb630a7f61d5381a724eff;p=libexpat Fix for bug #600479: error decoding UTF-8 triplet --- diff --git a/expat/lib/xmltok.c b/expat/lib/xmltok.c index 7fc00e89..0e9a18a2 100644 --- a/expat/lib/xmltok.c +++ b/expat/lib/xmltok.c @@ -84,7 +84,11 @@ #define UTF8_INVALID3(p) \ (((p)[2] & 0x80) == 0 \ || \ - ((*p) == 0xEF ? (p)[2] > 0xBD : ((p)[2] & 0xC0) == 0xC0) \ + ((*p) == 0xEF && (p)[1] == 0xBF \ + ? \ + (p)[2] > 0xBD \ + : \ + ((p)[2] & 0xC0) == 0xC0) \ || \ ((*p) == 0xE0 \ ? \