diff options
author | Christopher Ferris <cferris@google.com> | 2015-02-27 18:22:45 -0800 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2015-02-27 18:22:45 -0800 |
commit | cc9ca1051dbf5bd2af1b801de13d43a399521cf9 (patch) | |
tree | f8fd2edf4fd85c87a1b9259c821c4d8f9878b104 /libc/stdio | |
parent | e6a33cefe4b3759fb77d9e69356cb50a97ea7e54 (diff) | |
download | bionic-cc9ca1051dbf5bd2af1b801de13d43a399521cf9.zip bionic-cc9ca1051dbf5bd2af1b801de13d43a399521cf9.tar.gz bionic-cc9ca1051dbf5bd2af1b801de13d43a399521cf9.tar.bz2 |
Fix fread returning bad data.
Bug: 19172514
Change-Id: I05016577858a02aca7d14e75e6ec28abc925037c
Diffstat (limited to 'libc/stdio')
-rw-r--r-- | libc/stdio/fread.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/stdio/fread.c b/libc/stdio/fread.c index bac8dad..f3f0127 100644 --- a/libc/stdio/fread.c +++ b/libc/stdio/fread.c @@ -102,6 +102,12 @@ fread(void *buf, size_t size, size_t count, FILE *fp) * avoid copying it through the buffer? */ if (total > (size_t) fp->_bf._size) { + /* + * Make sure that fseek doesn't think it can + * reuse the buffer since we are going to read + * directly from the file descriptor. + */ + fp->_flags |= __SMOD; break; } |