1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +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

@ -95,7 +95,9 @@ _IO_wfile_doallocate (fp)
size = fp->_IO_buf_end - fp->_IO_buf_base;
if ((fp->_flags & _IO_USER_BUF))
size = (size + sizeof (wchar_t) - 1) / sizeof (wchar_t);
ALLOC_WBUF (p, size * sizeof (wchar_t), EOF);
p = malloc (size * sizeof (wchar_t));
if (__glibc_unlikely (p == NULL))
return EOF;
_IO_wsetb (fp, p, p + size, 1);
return 1;
}