]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
avoid crash in addLitExpression()
authorHong, Yang A <yang.a.hong@intel.com>
Tue, 14 Apr 2020 09:36:46 +0000 (09:36 +0000)
committerHong, Yang A <yang.a.hong@intel.com>
Mon, 25 May 2020 13:47:53 +0000 (13:47 +0000)
fixes github issue #205

src/compiler/compiler.cpp

index 3382ff4217b123560fcac97489d12fab17ebbe4f..de6909e762b1c7eea2e91603b33e967d7fbb073c 100644 (file)
@@ -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.");
     }