Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2006-04-07 23:26:10 +0400
committerJunio C Hamano <junkio@cox.net>2006-04-08 03:31:20 +0400
commit8960844a7890b1ac6ad5f8abf58a2a20923dde6d (patch)
tree680ed7cbcd0c3739dc8e34926d83115bcef6e889 /sha1_file.c
parent7d6c447145c07bb7d96a9aa17e33838fbe76e405 (diff)
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;