+2011-03-03 Andreas Schwab <schwab@redhat.com>
+
+ * libio/fmemopen.c (fmemopen): Don't read past end of buffer.
+
2011-03-03 Roland McGrath <roland@redhat.com>
* setjmp/bits/setjmp2.h: Canonicalize comment formatting.
/* Fmemopen implementation.
- Copyright (C) 2000, 2002, 2005, 2006, 2008, 2009
+ Copyright (C) 2000, 2002, 2005, 2006, 2008, 2009, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Hanno Mueller, kontakt@hanno.de, 2000.
if (mode[0] == 'w')
c->buffer[0] = '\0';
- c->maxpos = strlen (c->buffer);
+ c->maxpos = strnlen (c->buffer, len);
if (mode[0] == 'a')
c->pos = c->maxpos;