]> git.ipfire.org Git - thirdparty/coreutils.git/commit
cp: prefer signed types in copy-file-data.c
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 6 Aug 2025 19:11:34 +0000 (12:11 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 16 Sep 2025 06:17:35 +0000 (23:17 -0700)
commitc80f6eebdf56b53b2d284b00ea34cdf61f6a513f
tree917b159882a98816a146772a3b92f2a39b35a55f
parent12d03a04446a8da4f5dc3cacd6888416687dd8a2
cp: prefer signed types in copy-file-data.c

* src/copy-file-data.c (sparse_copy, lseek_copy)
(copy_file_data): Prefer idx_t to size_t.
(copy_file_data): Defend against st_size < 0, which can happen on
ancient buggy platforms.  Check for overflow; the old code was
wrong on theoretical-but-valid hosts where SIZE_MAX <= INT_MAX.
src/copy-file-data.c