git-commit-vandalism/contrib/scalar
Victoria Dye 91be401945 scalar-diagnose: avoid 32-bit overflow of size_t
Avoid 32-bit size_t overflow when reporting the available disk space in
'get_disk_info' by casting the block size and available block count to
'off_t' before multiplying them. Without this change, 'st_mult' would
(correctly) report a size_t overflow on 32-bit systems at or exceeding 2^32
bytes of available space.

Note that 'off_t' is a 64-bit integer even on 32-bit systems due to the
inclusion of '#define _FILE_OFFSET_BITS 64' in 'git-compat-util.h' (see
b97e911643 (Support for large files on 32bit systems., 2007-02-17)).

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-08-12 13:20:02 -07:00
..
t scalar-diagnose: use "$GIT_UNZIP" in test 2022-08-12 13:20:02 -07:00
.gitignore scalar: create a rudimentary executable 2021-12-04 21:52:23 -08:00
Makefile contrib/scalar: fix 'all' target in Makefile 2022-04-06 10:19:57 -07:00
scalar.c scalar-diagnose: avoid 32-bit overflow of size_t 2022-08-12 13:20:02 -07:00
scalar.txt scalar: reword command documentation to clarify purpose 2022-07-18 11:03:56 -07:00