Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
Technical documentation of the run-command API.
[gitweb.git]
/
sha1_file.c
diff --git
a/sha1_file.c
b/sha1_file.c
index 41799492f909e19d907fe5d954463f9fba177a4e..d9da7c8f75c8f44a62661d92b6f8e5266df83a73 100644
(file)
--- a/
sha1_file.c
+++ b/
sha1_file.c
@@
-1943,7
+1943,8
@@
void *read_object_with_reference(const unsigned char *sha1,
}
ref_length = strlen(ref_type);
- if (memcmp(buffer, ref_type, ref_length) ||
+ if (ref_length + 40 > isize ||
+ memcmp(buffer, ref_type, ref_length) ||
get_sha1_hex((char *) buffer + ref_length, actual_sha1)) {
free(buffer);
return NULL;