diff options
| author | Junio C Hamano <gitster@pobox.com> | 2016-08-08 14:48:41 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2016-08-08 14:48:41 -0700 |
| commit | 68e80da479ff940aea3f34447336e523b448f34c (patch) | |
| tree | 077a06f3e0602a16a0cf39b1636566809747fe3d /shallow.c | |
| parent | Merge branch 'ib/t3700-add-chmod-x-updates' (diff) | |
| parent | pass constants as first argument to st_mult() (diff) | |
| download | git-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |
