]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Fixed wrong assumption in Table::Open()
authorKosie van der Merwe <kosie.vandermerwe@gmail.com>
Wed, 9 Jan 2013 18:44:30 +0000 (10:44 -0800)
committerKosie van der Merwe <kosie.vandermerwe@gmail.com>
Wed, 9 Jan 2013 18:44:30 +0000 (10:44 -0800)
commit4e9d9d989f937b40472e4fae88b49fd99d1988ba
tree8e65d58e9a429c5b1f82b003a9c8e3d71ca179b0
parentf881d6f2266fe606c4848d8ff35d9374472b240e
Fixed wrong assumption in Table::Open()

Summary:
`Table::Open()` assumes that `size` correctly describes the size of `file`, added a check that the footer is actually the right size and for good measure added assertions to `Footer::DecodeFrom()`.

This was discovered by running `valgrind ./db_test` and seeing that `Footer::DecodeFrom()` was accessing uninitialized memory.

Test Plan:
make clean check

ran `valgrind ./db_test` and saw DBTest.NoSpace no longer complains about a conditional jump being dependent on uninitialized memory.

Reviewers: dhruba, vamsi, emayanke, sheki

Reviewed By: dhruba

CC: leveldb
Differential Revision: https://reviews.facebook.net/D7815
table/format.cc
table/table.cc