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:
Willi Ballenthin
2026-04-22 22:10:59 +03:00
committed by Willi Ballenthin
parent 861f3b8619
commit fc7f0533d7
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -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