Commit c5c07d26 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

EnsureUTF8: fix overlong detection (refs #4725)

parent 45f79d5d
......@@ -334,7 +334,7 @@ static char *CheckUTF8( char *str, char rep )
case 2:
if (cp < 128) // ASCII overlong
goto error;
if (cp < (1u << (5 * charlen - 3))) // overlong
if (cp < (1u << (5 * charlen - 4))) // overlong
goto error;
}
ptr += charlen;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment