Add bounds checking prior to IOs in vldb_check
authorRod Widdowson <rdw@steadingsoftware.com>
Wed, 19 May 2010 09:45:57 +0000 (10:45 +0100)
committerRuss Allbery <rra@stanford.edu>
Sun, 30 May 2010 20:10:57 +0000 (13:10 -0700)
commit16c4b6e6c06ef2e7cfe77bca0811af9001665805
tree13350b891657ded58c7632a98bb7b62171b1264a
parent20c2acfb2b2c5e6ab36c14726dce6197202f6d4a
Add bounds checking prior to IOs in vldb_check

vldb_check would just read where it was sent.  This means that if a
hash entry was beyond the end of file the read would fail and halt the
program dead.

This change adds checks for that so we can go limping on.

There is no code to fix this sort of corruption.  I have another
(preexisting) checkin to do that which will happen once I can get a
clean test run.

This checkin also removes a some pointless debugging printfs.

Change-Id: Ib285e113c8db024de41ffaf6c11ceb2979d07041
Reviewed-on: http://gerrit.openafs.org/1990
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
src/vlserver/vldb_check.c