File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1717- only parse CAPE fields required for analysis @mike-hunhoff #2607
1818- main: render result document without needing associated rules @williballenthin #2610
1919- vmray: only verify process OS and monitor IDs match @mike-hunhoff #2613
20+ - render: don't assume prior matches exist within a thread @mike-hunhoff #2612
2021
2122### capa Explorer Web
2223
Original file line number Diff line number Diff line change @@ -418,8 +418,9 @@ def from_capa(
418418 and a .id <= location .id
419419 ]
420420 )
421- _ , most_recent_match = matches_in_thread [- 1 ]
422- children .append (Match .from_capa (rules , capabilities , most_recent_match ))
421+ if matches_in_thread :
422+ _ , most_recent_match = matches_in_thread [- 1 ]
423+ children .append (Match .from_capa (rules , capabilities , most_recent_match ))
423424
424425 else :
425426 children .append (Match .from_capa (rules , capabilities , rule_matches [location ]))
@@ -478,8 +479,11 @@ def from_capa(
478479 and a .id <= location .id
479480 ]
480481 )
481- _ , most_recent_match = matches_in_thread [- 1 ]
482- children .append (Match .from_capa (rules , capabilities , most_recent_match ))
482+ # namespace matches may not occur within the same thread as the result, so only
483+ # proceed if a match within the same thread is found
484+ if matches_in_thread :
485+ _ , most_recent_match = matches_in_thread [- 1 ]
486+ children .append (Match .from_capa (rules , capabilities , most_recent_match ))
483487 else :
484488 if location in rule_matches :
485489 children .append (Match .from_capa (rules , capabilities , rule_matches [location ]))
You can’t perform that action at this time.
0 commit comments