mirror of
https://github.com/coreutils/coreutils.git
synced 2024-11-23 09:56:42 +08:00
sort: don’t trust st_size on /proc files
Problem and fix reported by Takashi Kusumi in: https://bugs.gnu.org/70231 * src/sort.c (sort_buffer_size): Don’t trust st_size == 0.
This commit is contained in:
parent
ac6b8d8224
commit
8ff3903281
@ -1539,7 +1539,7 @@ sort_buffer_size (FILE *const *fps, size_t nfps,
|
||||
!= 0)
|
||||
sort_die (_("stat failed"), files[i]);
|
||||
|
||||
if (S_ISREG (st.st_mode))
|
||||
if (usable_st_size (&st) && 0 < st.st_size)
|
||||
file_size = st.st_size;
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user