[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r4621 - in glibc-package/branches/eglibc-2.13/debian: . patches patches/any



Author: aurel32
Date: 2011-05-01 14:34:30 +0000 (Sun, 01 May 2011)
New Revision: 4621

Added:
   glibc-package/branches/eglibc-2.13/debian/patches/any/cvs-fopen.diff
Modified:
   glibc-package/branches/eglibc-2.13/debian/changelog
   glibc-package/branches/eglibc-2.13/debian/patches/series
Log:
  * Add patches/any/cvs-fopen.diff to fix fopen() with 7 bytes string.



Modified: glibc-package/branches/eglibc-2.13/debian/changelog
===================================================================
--- glibc-package/branches/eglibc-2.13/debian/changelog	2011-05-01 14:32:08 UTC (rev 4620)
+++ glibc-package/branches/eglibc-2.13/debian/changelog	2011-05-01 14:34:30 UTC (rev 4621)
@@ -152,6 +152,7 @@
   * Add patches/i386/cvs-memmove-static.diff to fix static linking
     with FORTIFY.
   * Add patches/amd64/cvs-getcontext.diff to fix getcontext() on amd64.
+  * Add patches/any/cvs-fopen.diff to fix fopen() with 7 bytes string.
 
   [ Samuel Thibault ]
   * Add patches/any/cvs-glro_dl_debug_mask.diff to fix build without

Added: glibc-package/branches/eglibc-2.13/debian/patches/any/cvs-fopen.diff
===================================================================
--- glibc-package/branches/eglibc-2.13/debian/patches/any/cvs-fopen.diff	                        (rev 0)
+++ glibc-package/branches/eglibc-2.13/debian/patches/any/cvs-fopen.diff	2011-05-01 14:34:30 UTC (rev 4621)
@@ -0,0 +1,75 @@
+2011-04-22  Ulrich Drepper  <drepper@gmail.com>
+
+	[BZ #12685]
+	* libio/fileops.c (_IO_new_file_fopen): Scan up to 7 bytes of the
+	mode string.
+	Patch by Eric Blake <eblake@redhat.com>.
+
+diff --git a/libio/fileops.c b/libio/fileops.c
+index eba2768..ea730ac 100644
+--- a/libio/fileops.c
++++ b/libio/fileops.c
+@@ -290,7 +290,7 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
+ #ifdef _LIBC
+   last_recognized = mode;
+ #endif
+-  for (i = 1; i < 6; ++i)
++  for (i = 1; i < 7; ++i)
+     {
+       switch (*++mode)
+ 	{
+@@ -997,18 +997,18 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
+       /* Adjust for read-ahead (bytes is buffer). */
+       offset -= fp->_IO_read_end - fp->_IO_read_ptr;
+       if (fp->_offset == _IO_pos_BAD)
+-        {
+-          if (mode != 0)
+-            goto dumb;
+-          else
+-            {
+-              result = _IO_SYSSEEK (fp, 0, dir);
+-              if (result == EOF)
+-                return result;
+-
+-              fp->_offset = result;
+-            }
+-        }
++	{
++	  if (mode != 0)
++	    goto dumb;
++	  else
++	    {
++	      result = _IO_SYSSEEK (fp, 0, dir);
++	      if (result == EOF)
++		return result;
++
++	      fp->_offset = result;
++	    }
++	}
+       /* Make offset absolute, assuming current pointer is file_ptr(). */
+       offset += fp->_offset;
+       if (offset < 0)
+@@ -1270,7 +1270,7 @@ _IO_new_file_write (f, data, n)
+ 	{
+ 	  f->_flags |= _IO_ERR_SEEN;
+ 	  break;
+-        }
++	}
+       to_do -= count;
+       data = (void *) ((char *) data + count);
+     }
+@@ -1358,12 +1358,12 @@ _IO_new_file_xsputn (f, data, n)
+       do_write = to_do - (block_size >= 128 ? to_do % block_size : 0);
+ 
+       if (do_write)
+-        {
++	{
+ 	  count = new_do_write (f, s, do_write);
+ 	  to_do -= count;
+ 	  if (count < do_write)
+ 	    return n - to_do;
+-        }
++	}
+ 
+       /* Now write out the remainder.  Normally, this will fit in the
+ 	 buffer, but it's somewhat messier for line-buffered files,

Modified: glibc-package/branches/eglibc-2.13/debian/patches/series
===================================================================
--- glibc-package/branches/eglibc-2.13/debian/patches/series	2011-05-01 14:32:08 UTC (rev 4620)
+++ glibc-package/branches/eglibc-2.13/debian/patches/series	2011-05-01 14:34:30 UTC (rev 4621)
@@ -244,3 +244,4 @@
 any/cvs-rtld-prelink.diff
 any/local-linuxthreads-deps.diff
 any/local-ldconfig-multiarch.diff
+any/cvs-fopen.diff


Reply to: