mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-10-01 12:07:42 +03:00
hscollider: fix input length for UTF8 check
This commit is contained in:
committed by
Chang, Harry
parent
f877f14641
commit
08b00f6149
@@ -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.");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user