From 8960844a7890b1ac6ad5f8abf58a2a20923dde6d Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Fri, 7 Apr 2006 15:26:10 -0400 Subject: check patch_delta bounds more carefully Let's avoid going south with invalid delta data. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- sha1_file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sha1_file.c') diff --git a/sha1_file.c b/sha1_file.c index aa09b4646a..d8ef565561 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -804,10 +804,12 @@ static int packed_delta_info(unsigned char *base_sha1, * the result size. */ data = delta_head; - get_delta_hdr_size(&data); /* ignore base size */ + + /* ignore base size */ + get_delta_hdr_size(&data, delta_head+sizeof(delta_head)); /* Read the result size */ - result_size = get_delta_hdr_size(&data); + result_size = get_delta_hdr_size(&data, delta_head+sizeof(delta_head)); *sizep = result_size; } return 0; -- cgit v1.2.3