about summary refs log tree commit diff
path: root/libio/filedoalloc.c
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2015-08-12 18:56:08 -0700
committerPaul Pluzhnikov <ppluzhnikov@google.com>2015-08-12 18:56:08 -0700
commit8a29509dd9aa179bfe4ef96d49d72f6816ec878f (patch)
tree3adc134bbc346804b13acf375b1dfa287225ea44 /libio/filedoalloc.c
parent84895dca70f972df3842fb88f7b33b5d695cc599 (diff)
downloadglibc-8a29509dd9aa179bfe4ef96d49d72f6816ec878f.tar.gz
glibc-8a29509dd9aa179bfe4ef96d49d72f6816ec878f.tar.xz
glibc-8a29509dd9aa179bfe4ef96d49d72f6816ec878f.zip
Fix BZ #16734 -- fopen calls mmap to allocate its buffer
Diffstat (limited to 'libio/filedoalloc.c')
-rw-r--r--libio/filedoalloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libio/filedoalloc.c b/libio/filedoalloc.c
index 918a24aa14..78aa3d5236 100644
--- a/libio/filedoalloc.c
+++ b/libio/filedoalloc.c
@@ -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;
 }