summaryrefslogtreecommitdiff
path: root/argv-array.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-07-28 20:21:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-28 22:02:17 (GMT)
commit819f0e76b110458488c41741b0dcd538483848c0 (patch)
tree19dadce2b11898856e1a2a06666ee97be3ca04af /argv-array.c
parent47ae905ffb98cc4d4fd90083da6bc8dab55d9ecc (diff)
downloadgit-819f0e76b110458488c41741b0dcd538483848c0.zip
git-819f0e76b110458488c41741b0dcd538483848c0.tar.gz
git-819f0e76b110458488c41741b0dcd538483848c0.tar.bz2
argv-array: use size_t for count and alloc
On most 64-bit platforms, "int" is significantly smaller than a size_t, which could lead to integer overflow and under-allocation of the array. It's probably impossible to trigger in practice, as it would imply on the order of 2^32 individual allocations. Even if was possible to grow an array in that way (and we typically only use it for sets of strings, like command line options), each allocation needs a pointer, malloc overhead, etc. You'd quite likely run out of RAM before succeeding in such an overflow. But all that hand-waving aside, it's easy enough to use the correct type, so let's do so. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'argv-array.c')
0 files changed, 0 insertions, 0 deletions