This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.13-37-g13a804d


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  13a804de8f3091e8ccd9b650f61becd6e1304227 (commit)
       via  9d25c392ba73065ac20f518d1cef1cdc96860545 (commit)
      from  a5543c6ad807f0b8ea793cb6d385f3dbeb0d98c5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=13a804de8f3091e8ccd9b650f61becd6e1304227

commit 13a804de8f3091e8ccd9b650f61becd6e1304227
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Fri Mar 4 00:49:46 2011 -0500

    Optimize fmemopen a bit.

diff --git a/ChangeLog b/ChangeLog
index 16da2c1..c6d652d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-04  Ulrich Drepper  <drepper@gmail.com>
+
+	* libio/fmemopen.c (fmemopen): Optimize a bit.
+
 2011-03-03  Andreas Schwab  <schwab@redhat.com>
 
 	* libio/fmemopen.c (fmemopen): Don't read past end of buffer.
diff --git a/libio/fmemopen.c b/libio/fmemopen.c
index 1a631d5..75f9f7e 100644
--- a/libio/fmemopen.c
+++ b/libio/fmemopen.c
@@ -226,6 +226,7 @@ fmemopen (void *buf, size_t len, const char *mode)
 	  return NULL;
 	}
       c->buffer[0] = '\0';
+      c->maxpos = 0;
     }
   else
     {
@@ -236,14 +237,14 @@ fmemopen (void *buf, size_t len, const char *mode)
 	}
 
       c->buffer = buf;
-    }
 
-  c->size = len;
+      if (mode[0] == 'w')
+	c->buffer[0] = '\0';
 
-  if (mode[0] == 'w')
-    c->buffer[0] = '\0';
+      c->maxpos = strnlen (c->buffer, len);
+    }
 
-  c->maxpos = strnlen (c->buffer, len);
+  c->size = len;
 
   if (mode[0] == 'a')
     c->pos = c->maxpos;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9d25c392ba73065ac20f518d1cef1cdc96860545

commit 9d25c392ba73065ac20f518d1cef1cdc96860545
Author: Andreas Schwab <schwab@redhat.com>
Date:   Fri Mar 4 00:48:00 2011 -0500

    Don't read past end of buffer in fmemopen

diff --git a/ChangeLog b/ChangeLog
index 2cfa1e4..16da2c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+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.
diff --git a/libio/fmemopen.c b/libio/fmemopen.c
index d3750fc..1a631d5 100644
--- a/libio/fmemopen.c
+++ b/libio/fmemopen.c
@@ -1,5 +1,5 @@
 /* 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.
@@ -243,7 +243,7 @@ fmemopen (void *buf, size_t len, const char *mode)
   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;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog        |    8 ++++++++
 libio/fmemopen.c |   13 +++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]