Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
ref-filter: add check for negative file size
author
Olga Telezhnaya
<olyatelezhnaya@gmail.com>
Mon, 24 Dec 2018 13:24:30 +0000
(13:24 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 28 Dec 2018 18:07:34 +0000
(10:07 -0800)
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>
ref-filter.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
1867ce6
)
diff --git
a/ref-filter.c
b/ref-filter.c
index 252daf2812480d61efe2669c3be3d9dcc134cfdc..6753c45660dfc8379f75374b57df05ea29f84904 100644
(file)
--- 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);