Details
-
Bug
-
Status: Closed
-
Critical - P2
-
Resolution: Fixed
-
1.3.1
-
None
-
ruby 1.8.7 on linux
-
Fully Compatible
Description
BSON::OrderedHash can be corrupted
steps to reproduce:
execute the following lines:
a = BSON::OrderedHash.new
a[:b] = :c
a.replace(:c => :d)
results
a is corrupted. For instance it inspects as:
{"b"=>nil}instead of:
{:c => :d}
the method 'replace' on Hash is not overridden !!!!!!!
implementation suggestion:
def replace(other_hash)
@ordered_keys.replace(other_hash.keys)
super
end