summary refs log tree commit diff
path: root/libio/fmemopen.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2015-06-25 11:53:06 +0200
committerAndreas Schwab <schwab@suse.de>2015-06-25 15:54:09 +0200
commit7c2ce714d4e853aadbec13b920576fdfada520f1 (patch)
tree90876240dcbfc51809b22803b0b05054ead2bade /libio/fmemopen.c
parentcc08749b2d1c68284b25b157fbbe1ff219495cae (diff)
downloadglibc-7c2ce714d4e853aadbec13b920576fdfada520f1.tar.gz
glibc-7c2ce714d4e853aadbec13b920576fdfada520f1.tar.xz
glibc-7c2ce714d4e853aadbec13b920576fdfada520f1.zip
Fix buffer overflow for writes to memory buffer stream (bug 18549)
Diffstat (limited to 'libio/fmemopen.c')
-rw-r--r--libio/fmemopen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libio/fmemopen.c b/libio/fmemopen.c
index 6c50fba221..06e5ab8002 100644
--- a/libio/fmemopen.c
+++ b/libio/fmemopen.c
@@ -124,7 +124,7 @@ fmemopen_write (void *cookie, const char *b, size_t s)
 
   if (c->pos + s + addnullc > c->size)
     {
-      if ((size_t) (c->pos + addnullc) == c->size)
+      if ((size_t) (c->pos + addnullc) >= c->size)
 	{
 	  __set_errno (ENOSPC);
 	  return 0;