hscollider: fix input length for UTF8 check

This commit is contained in:
Wang, Xiang W
2018-04-17 23:26:04 -04:00
committed by Chang, Harry
parent f877f14641
commit 08b00f6149
5 changed files with 8 additions and 6 deletions

View File

@@ -118,7 +118,8 @@ ParsedExpression::ParsedExpression(unsigned index_in, const char *expression,
expr.utf8 = mode.utf8; /* utf8 may be set by parse() */
if (expr.utf8 && !isValidUtf8(expression)) {
const size_t len = strlen(expression);
if (expr.utf8 && !isValidUtf8(expression, len)) {
throw ParseError("Expression is not valid UTF-8.");
}