Skip to content

Commit

Permalink
[BUGFIX] In load_pattern_file: delete signatures after filling in the…
Browse files Browse the repository at this point in the history
… matcher
  • Loading branch information
hasherezade committed Feb 16, 2024
1 parent cf75d0c commit f7faf4b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions utils/artefacts_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,13 @@ size_t pesieve::matcher::load_pattern_file(const char* filename)
isLoaded = true;
std::vector<Signature*> signatures;
Signature::loadFromFile(filename, signatures);
if (!mainMatcher.addPatterns(signatures)) {
return 0;
const size_t added = mainMatcher.addPatterns(signatures);
// delete the loaded signatures:
for (auto itr = signatures.begin(); itr != signatures.end(); ++itr) {
Signature* sign = *itr;
delete sign;
}
return signatures.size();
return added;
}

bool pesieve::matcher::init_shellcode_patterns()
Expand Down

0 comments on commit f7faf4b

Please sign in to comment.