aboutsummaryrefslogtreecommitdiffstats
path: root/shallow.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-08-08 14:48:41 -0700
committerJunio C Hamano <gitster@pobox.com>2016-08-08 14:48:41 -0700
commit68e80da479ff940aea3f34447336e523b448f34c (patch)
tree077a06f3e0602a16a0cf39b1636566809747fe3d /shallow.c
parentMerge branch 'ib/t3700-add-chmod-x-updates' (diff)
parentpass constants as first argument to st_mult() (diff)
downloadgit-68e80da479ff940aea3f34447336e523b448f34c.tar.gz
git-68e80da479ff940aea3f34447336e523b448f34c.zip
Merge branch 'rs/st-mult'
Micro optimization of st_mult() facility used to check the integer overflow coming from multiplication to compute size of memory allocation. * rs/st-mult: pass constants as first argument to st_mult()
Diffstat (limited to 'shallow.c')
-rw-r--r--shallow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shallow.c b/shallow.c
index 4d554caf8d..54e2db7334 100644
--- a/shallow.c
+++ b/shallow.c
@@ -389,7 +389,7 @@ static void paint_down(struct paint_info *info, const unsigned char *sha1,
unsigned int i, nr;
struct commit_list *head = NULL;
int bitmap_nr = (info->nr_bits + 31) / 32;
- size_t bitmap_size = st_mult(bitmap_nr, sizeof(uint32_t));
+ size_t bitmap_size = st_mult(sizeof(uint32_t), bitmap_nr);
uint32_t *tmp = xmalloc(bitmap_size); /* to be freed before return */
uint32_t *bitmap = paint_alloc(info);
struct commit *c = lookup_commit_reference_gently(sha1, 1);