summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorLibravatar Nicolas Pitre <nico@cam.org>2006-04-07 15:26:10 -0400
committerLibravatar Junio C Hamano <junkio@cox.net>2006-04-07 16:31:20 -0700
commit8960844a7890b1ac6ad5f8abf58a2a20923dde6d (patch)
tree680ed7cbcd0c3739dc8e34926d83115bcef6e889 /sha1_file.c
parentdiff_flush(): leakfix. (diff)
downloadtgif-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.c6
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;