jfsck(): Check there's enough room for the checksum before computing it
commit94fef4e511d2b39590d9c5fa14c5ba7832465516
authorAlberto Bertogli <albertito@blitiri.com.ar>
Mon, 9 Mar 2009 01:14:31 +0000 (8 23:14 -0200)
committerAlberto Bertogli <albertito@blitiri.com.ar>
Mon, 9 Mar 2009 05:26:36 +0000 (9 03:26 -0200)
tree2dd5b416322675412ef80fad7703a78636429d3a
parente944720de06adb5cdc907537f896c56681dac882
jfsck(): Check there's enough room for the checksum before computing it

Before computing the checksum in jfsck(), see if the file is long enough
to contain it. Otherwise, if the transaction file was truncated, we
would check the checksum anyways.

This is usually not a problem because the checksums shouldn't match, but
it's better to play safe. Also, it properly report such transactions as
broken instead of corrupt.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
check.c