Update yara to 4.2.3 and fix output reading 0 matches

This commit is contained in:
Matt C 2022-09-17 23:48:11 +01:00
parent c2cf535f88
commit 8f710461da
5 changed files with 34 additions and 10 deletions

View file

@ -100,7 +100,7 @@ class YARARules extends Operation {
}
meta = meta.slice(0, -2) + "]";
}
const countString = showCounts ? `${matches.size()} time${matches.size() > 1 ? "s" : ""}` : "";
const countString = matches.size() === 0 ? "" : (showCounts ? `${matches.size()} time${matches.size() > 1 ? "s" : ""}` : "");
if (matches.size() === 0 || !(showStrings || showLengths)) {
matchString += `Input matches rule "${rule.ruleName}"${meta}${countString.length > 0 ? ` ${countString}`: ""}.\n`;
} else {