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 \ ? \