diff options
author | Nicolas Pitre <nico@cam.org> | 2006-04-07 15:26:10 -0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-04-07 16:31:20 -0700 |
commit | 8960844a7890b1ac6ad5f8abf58a2a20923dde6d (patch) | |
tree | 680ed7cbcd0c3739dc8e34926d83115bcef6e889 /sha1_file.c | |
parent | diff_flush(): leakfix. (diff) | |
download | tgif-8960844a7890b1ac6ad5f8abf58a2a20923dde6d.tar.xz |
check patch_delta bounds more carefully
Let's avoid going south with invalid delta data.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |