fix: correct off-by-one in call_count debug log for dynamic analysis

`enumerate` is 0-based, so after the loop `call_count` held `n - 1` for
`n` calls processed. The debug log at the end of `find_thread_capabilities`
therefore reported one fewer event than was actually analyzed. Replace
`enumerate` with an explicit `call_count += 1` counter so the log is
accurate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Willi Ballenthin
2026-04-22 17:33:06 +03:00
co-authored by Claude Sonnet 4.6
parent 47760269f8
commit cb3376d9e2
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -11,6 +11,7 @@
-
### Bug Fixes
- fix: correct off-by-one in dynamic analysis call_count debug log (enumerate -> explicit counter) @williballenthin
- fix: correct capa/subscope-rule key in RuleMetadata so is_subscope_rule is no longer always False @williballenthin
- fix: remove unreachable backports.functools_lru_cache fallback and dead dependency @williballenthin
- fix: add missing ELF branch in get_format_from_extension for .elf_ files @williballenthin #3031
+2 -1
View File
@@ -177,7 +177,8 @@ def find_thread_capabilities(
span_matcher = SpanOfCallsMatcher(ruleset)
call_count = 0
for call_count, ch in enumerate(extractor.get_calls(ph, th)): # noqa: B007
for ch in extractor.get_calls(ph, th):
call_count += 1
call_capabilities = find_call_capabilities(ruleset, extractor, ph, th, ch)
for feature, vas in call_capabilities.features.items():
features[feature].update(vas)