mirror of
https://github.com/mandiant/capa.git
synced 2026-06-12 19:11:32 -07:00
fix: correct operator precedence in FeatureRegexRegistryControlSetMatchIncomplete
The `or "currentcontrolset" in pat` branch triggered the lint for any regex containing "currentcontrolset", even unrelated paths like HKLM\Software\CurrentControlSet that don't need the system\\ fix. Fix by requiring "system\\\\" in both branches of the condition.
This commit is contained in:
committed by
Willi Ballenthin
parent
861f3b8619
commit
fc7f0533d7
+1
-1
@@ -752,7 +752,7 @@ class FeatureRegexRegistryControlSetMatchIncomplete(Lint):
|
||||
|
||||
pat = feature.value.lower()
|
||||
|
||||
if "system\\\\" in pat and "controlset" in pat or "currentcontrolset" in pat:
|
||||
if "system\\\\" in pat and ("controlset" in pat or "currentcontrolset" in pat):
|
||||
if "system\\\\(controlset\\d{3}|currentcontrolset)" not in pat:
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user