summaryrefslogtreecommitdiff
path: root/git-gui/lib/diff.tcl
diff options
context:
space:
mode:
authorVictoria Dye <vdye@github.com>2022-08-12 20:10:10 +0000
committerJunio C Hamano <gitster@pobox.com>2022-08-12 13:20:02 -0700
commit91be401945a58c95a61c94bd5ab5ed25d143803d (patch)
treee5a6eeacee79c0e770bd06e2345960fd3ace4b4d /git-gui/lib/diff.tcl
parent81ad5513431c9c20f3ec41b6713d4ca602ed4a07 (diff)
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>
Diffstat (limited to 'git-gui/lib/diff.tcl')
0 files changed, 0 insertions, 0 deletions