Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
avoid possible overflow in delta size filtering computation
[gitweb.git]
/
builtin-pack-objects.c
diff --git
a/builtin-pack-objects.c
b/builtin-pack-objects.c
index fb5e14d56e5b9fec0a054eb9708be41a59ac0f13..84a13c7ccd4c04df2d45b7130ef7005643e42cb6 100644
(file)
--- a/
builtin-pack-objects.c
+++ b/
builtin-pack-objects.c
@@
-1265,7
+1265,7
@@
static int try_delta(struct unpacked *trg, struct unpacked *src,
max_size = trg_entry->delta_size;
ref_depth = trg->depth;
}
- max_size = max_size * (max_depth - src->depth) /
+ max_size =
(uint64_t)
max_size * (max_depth - src->depth) /
(max_depth - ref_depth + 1);
if (max_size == 0)
return 0;