From 8a29509dd9aa179bfe4ef96d49d72f6816ec878f Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Wed, 12 Aug 2015 18:56:08 -0700 Subject: Fix BZ #16734 -- fopen calls mmap to allocate its buffer --- libio/wfiledoalloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libio/wfiledoalloc.c') diff --git a/libio/wfiledoalloc.c b/libio/wfiledoalloc.c index 12425fd..4acf3f8 100644 --- a/libio/wfiledoalloc.c +++ b/libio/wfiledoalloc.c @@ -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; } -- cgit v1.1