diff options
author | René Scharfe <l.s.r@web.de> | 2024-03-31 20:53:07 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-03-31 16:00:36 -0700 |
commit | ffeaf2f76ab422428d6190d0cfbca2f34f06602a (patch) | |
tree | 15729fa77bc7df1789cbf94c630187bb7409df82 /commit.c | |
parent | f39addd0d9d75a073847ed4311079a499dd33f35 (diff) |
mem-pool: use st_add() in mem_pool_strvfmt()
If len is INT_MAX in mem_pool_strvfmt(), then len + 1 overflows.
Casting it to size_t would prevent that. Use st_add() to go a step
further and make the addition *obviously* safe. The compiler can
optimize the check away on platforms where SIZE_MAX > INT_MAX, i.e.
basically everywhere.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions