introspect the RHS since it it is not guaranteed to be a Datastore

GSoC/Meterpreter_Web_Console
Brent Cook 2018-04-24 06:15:05 -05:00
parent d34119548d
commit 505810ffd6
1 changed files with 6 additions and 10 deletions

View File

@ -220,19 +220,15 @@ class DataStore < Hash
end end
def merge!(other) def merge!(other)
self.options.merge!(other.options) super
self.aliases.merge!(other.aliases) self.aliases.merge!(other.aliases) if other.respond_to?(:aliases)
self.imported.merge!(other.imported) self.imported.merge!(other.imported) if other.respond_to?(:imported)
self.imported_by.merge!(other.imported_by) self.imported_by.merge!(other.imported_by) if other.respond_to?(:imported_by)
end end
def merge(other) def merge(other)
ds = copy ds = self.copy
ds.options.merge!(other.options) ds.merge!(other)
ds.aliases.merge!(other.aliases)
ds.imported.merge!(other.imported)
ds.imported_by.merge!(other.imported_by)
ds
end end
# #