Skip to content

Commit

Permalink
Removed questionable check in NTFS code.
Browse files Browse the repository at this point in the history
It appears the code is attempting to test for valid data, and raising an error
when the class of the returned data item is Bignum. This should only happen
when the data in question is corrupt, so there shouldn't be an explicit test for it.

Given the test is breaking Ruby 2.4 tests, I'm removing the test.
  • Loading branch information
roliveri committed Jun 1, 2017
1 parent 4555cfc commit e1e223f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/fs/ntfs/directory_index_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ def initialize(buf)
# Child node VCN is located 8 bytes before 'length' bytes.
# NOTE: If the node has 0 contents, it's offset 16.
@child = buf[@contentLen == 0 ? 16 : @length - 8, 8].unpack('Q')[0]
if @child.class == Bignum
# buf.hex_dump(:obj => STDOUT, :meth => :puts, :newline => false)
raise "MIQ(NTFS::DirectoryIndexNode.initialize) Bad child node: #{@child}"
end
end
end

Expand Down

0 comments on commit e1e223f

Please sign in to comment.