summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-12-05 23:10:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-12-05 23:10:20 (GMT)
commit62cdb6b23a7c6cf527d8f8c470c7d463f6ca9f6d (patch)
treefdcb93f4cd15caafa1aa7f506202e7f42ff30c7c /sha1_file.c
parent9a6e2d77e91af34ebc6679ba3250524504083284 (diff)
parentea4f9685cb432caf357ad8af56a91877b6d04663 (diff)
downloadgit-62cdb6b23a7c6cf527d8f8c470c7d463f6ca9f6d.zip
git-62cdb6b23a7c6cf527d8f8c470c7d463f6ca9f6d.tar.gz
git-62cdb6b23a7c6cf527d8f8c470c7d463f6ca9f6d.tar.bz2
Merge branch 'nd/misc-cleanups'
* nd/misc-cleanups: unpack_object_header_buffer(): clear the size field upon error tree_entry_interesting: make use of local pointer "item" tree_entry_interesting(): give meaningful names to return values read_directory_recursive: reduce one indentation level get_tree_entry(): do not call find_tree_entry() on an empty tree tree-walk.c: do not leak internal structure in tree_entry_len()
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 6dcae38..956422b 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1267,7 +1267,8 @@ unsigned long unpack_object_header_buffer(const unsigned char *buf,
while (c & 0x80) {
if (len <= used || bitsizeof(long) <= shift) {
error("bad object header");
- return 0;
+ size = used = 0;
+ break;
}
c = buf[used++];
size += (c & 0x7f) << shift;