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:
authorOlga Telezhnaya <olyatelezhnaya@gmail.com>2018-12-24 16:24:30 +0300
committerJunio C Hamano <gitster@pobox.com>2018-12-28 21:07:34 +0300
commit5305a55348c102475c1bcb56e8fcbabe37178112 (patch)
tree8c47447fd6519fd9985dae19bdd860b3ba4db82d /ref-filter.c
parent1867ce6cbec9c8f23f958cb675de129fcd6471a4 (diff)
ref-filter: add check for negative file size
If we have negative file size, we are doing something wrong. Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ref-filter.c')
-rw-r--r--ref-filter.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ref-filter.c b/ref-filter.c
index 252daf2812..6753c45660 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1487,6 +1487,8 @@ static int get_object(struct ref_array_item *ref, int deref, struct object **obj
OBJECT_INFO_LOOKUP_REPLACE))
return strbuf_addf_ret(err, -1, _("missing object %s for %s"),
oid_to_hex(&oi->oid), ref->refname);
+ if (oi->info.disk_sizep && oi->disk_size < 0)
+ BUG("Object size is less than zero.");
if (oi->info.contentp) {
*obj = parse_object_buffer(the_repository, &oi->oid, oi->type, oi->size, oi->content, &eaten);