1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

libio: Limit buffer size to 8192 bytes [BZ #4099]

This avoids overly large buffers with network file systems which report
very large block sizes.
This commit is contained in:
Florian Weimer
2016-11-30 14:59:27 +01:00
parent 934fc4773e
commit 705a79f825
3 changed files with 13 additions and 1 deletions

View File

@ -94,7 +94,7 @@ _IO_file_doallocate (_IO_FILE *fp)
fp->_flags |= _IO_LINE_BUF;
}
#if _IO_HAVE_ST_BLKSIZE
if (st.st_blksize > 0)
if (st.st_blksize > 0 && st.st_blksize < _IO_BUFSIZ)
size = st.st_blksize;
#endif
}