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

Fix BZ #16734 -- fopen calls mmap to allocate its buffer

This commit is contained in:
Paul Pluzhnikov
2015-08-12 18:56:08 -07:00
parent 84895dca70
commit 8a29509dd9
8 changed files with 36 additions and 55 deletions

View File

@ -125,7 +125,9 @@ _IO_file_doallocate (fp)
size = st.st_blksize;
#endif
}
ALLOC_BUF (p, size, EOF);
p = malloc (size);
if (__glibc_unlikely (p == NULL))
return EOF;
_IO_setb (fp, p, p + size, 1);
return 1;
}