From: Hong, Yang A Date: Tue, 14 Apr 2020 09:36:46 +0000 (+0000) Subject: avoid crash in addLitExpression() X-Git-Tag: v5.3.0^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8344395bfd28a1b479f3a08ddbd0f2c2d43876e5;p=thirdparty%2Fvectorscan.git avoid crash in addLitExpression() fixes github issue #205 --- diff --git a/src/compiler/compiler.cpp b/src/compiler/compiler.cpp index 3382ff42..de6909e7 100644 --- a/src/compiler/compiler.cpp +++ b/src/compiler/compiler.cpp @@ -402,7 +402,7 @@ void addLitExpression(NG &ng, unsigned index, const char *expression, } // Ensure that our pattern isn't too long (in characters). - if (strlen(expression) > cc.grey.limitPatternLength) { + if (expLength > cc.grey.limitPatternLength) { throw CompileError("Pattern length exceeds limit."); }