Re: [PATCH] sha1_file: don't convert off_t to size_t too early to avoid potential die()

2014-09-22 Thread Junio C Hamano
Steffen Prohaska writes: > This patch should be applied on top of sp/stream-clean-filter. ... or it can be squashed in as a fix, as the topic is not yet in 'next'. > index_stream() might internally also be able to handle large files to > some extent. But it uses size_t for its third argument,

Re: [PATCH] sha1_file: don't convert off_t to size_t too early to avoid potential die()

2014-09-22 Thread Junio C Hamano
Steffen Prohaska writes: > xsize_t() checks if an off_t argument can be safely converted to > a size_t return value. If the check is executed too early, it could > fail for large files on 32-bit architectures even if the size_t code > path is not taken. Other paths might be able to handle the l

[PATCH] sha1_file: don't convert off_t to size_t too early to avoid potential die()

2014-09-21 Thread Steffen Prohaska
xsize_t() checks if an off_t argument can be safely converted to a size_t return value. If the check is executed too early, it could fail for large files on 32-bit architectures even if the size_t code path is not taken. Other paths might be able to handle the large file. Specifically, index_stre