From 86c927edb7ffec12d5c8878aa50d8ec08a5e7f76 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 18 Jan 2018 00:16:42 -0600 Subject: [PATCH] fix msfvenom referencing a nil typed_module_set --- lib/msf/core/module_manager/cache.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/msf/core/module_manager/cache.rb b/lib/msf/core/module_manager/cache.rb index b8f46ddae8..4094520e2b 100644 --- a/lib/msf/core/module_manager/cache.rb +++ b/lib/msf/core/module_manager/cache.rb @@ -175,8 +175,10 @@ module Msf::ModuleManager::Cache # Don't want to trigger as {Msf::ModuleSet#create} so check for # key instead of using ||= which would call {Msf::ModuleSet#[]} # which would potentially call {Msf::ModuleSet#create}. - unless typed_module_set.has_key? reference_name - typed_module_set[reference_name] = Msf::SymbolicModule + if typed_module_set + unless typed_module_set.has_key?(reference_name) + typed_module_set[reference_name] = Msf::SymbolicModule + end end end