diff --git a/src/RuleMatcher.cc b/src/RuleMatcher.cc index 65fbe5602d..5e9dff0a1f 100644 --- a/src/RuleMatcher.cc +++ b/src/RuleMatcher.cc @@ -686,6 +686,10 @@ RuleMatcher::MIME_Matches* RuleMatcher::Match(RuleFileMagicState* state, loop_over_list(r->actions, rai) { const RuleActionMIME* ram = dynamic_cast(r->actions[rai]); + + if ( ! ram ) + continue; + set& ss = (*rval)[ram->GetStrength()]; ss.insert(ram->GetMIME()); } diff --git a/src/analyzer/protocol/file/File.cc b/src/analyzer/protocol/file/File.cc index 7c471e17cf..4476043721 100644 --- a/src/analyzer/protocol/file/File.cc +++ b/src/analyzer/protocol/file/File.cc @@ -49,12 +49,9 @@ void File_Analyzer::Done() void File_Analyzer::Identify() { - RuleFileMagicState* fms = rule_matcher->InitFileMagic(); RuleMatcher::MIME_Matches matches; - - rule_matcher->Match(fms, reinterpret_cast(buffer), - buffer_len, &matches); - + file_mgr->DetectMIME(reinterpret_cast(buffer), buffer_len, + &matches); string match = matches.empty() ? "" : *(matches.begin()->second.begin()); val_list* vl = new val_list;