better validation on delta base object offsets
commitd8f325563d85abcd9816311b3a84093b2d1cda9f
authorNicolas Pitre <nico@cam.org>
Wed, 29 Oct 2008 23:02:45 +0000 (29 19:02 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 2 Nov 2008 23:22:34 +0000 (2 15:22 -0800)
treef564b9bd64fd42b1bc38dfa8b0e80f52c78f60eb
parent0e8189e2708bc1da08c77c7e1d960f420b6890a5
better validation on delta base object offsets

In one case, it was possible to have a bad offset equal to 0 effectively
pointing a delta onto itself and crashing git after too many recursions.
In the other cases, a negative offset could result due to off_t being
signed.  Catch those.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-pack-objects.c
builtin-unpack-objects.c
index-pack.c
sha1_file.c