diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2015-08-12 18:56:08 -0700 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2015-08-12 18:56:08 -0700 |
commit | 8a29509dd9aa179bfe4ef96d49d72f6816ec878f (patch) | |
tree | 3adc134bbc346804b13acf375b1dfa287225ea44 /libio/wfiledoalloc.c | |
parent | 84895dca70f972df3842fb88f7b33b5d695cc599 (diff) | |
download | glibc-8a29509dd9aa179bfe4ef96d49d72f6816ec878f.tar.gz glibc-8a29509dd9aa179bfe4ef96d49d72f6816ec878f.tar.xz glibc-8a29509dd9aa179bfe4ef96d49d72f6816ec878f.zip |
Fix BZ #16734 -- fopen calls mmap to allocate its buffer
Diffstat (limited to 'libio/wfiledoalloc.c')
-rw-r--r-- | libio/wfiledoalloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libio/wfiledoalloc.c b/libio/wfiledoalloc.c index 12425fd5a7..4acf3f8fc7 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; } |