From: Jeff King Date: Wed, 27 Sep 2017 06:02:21 +0000 (-0400) Subject: worktree: use xsize_t to access file size X-Git-Tag: v2.15.0-rc0~19^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/228740b67b55f4ee23637bd1472a73ae50efe93a?hp=228740b67b55f4ee23637bd1472a73ae50efe93a worktree: use xsize_t to access file size To read the "gitdir" file into memory, we stat the file and allocate a buffer. But we store the size in an "int", which may be truncated. We should use a size_t and xsize_t(), which will detect truncation. An overflow is unlikely for a "gitdir" file, but it's a good practice to model. Signed-off-by: Jeff King Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano ---