Apply patches from the debian package default tip
author"Luc Saillard <luc@saillard.org>"
Thu Feb 14 18:27:12 2008 +0100 (11 years ago)
changeset 41e8d83dfb76d
parent 3a6edb0ee3dd2
Apply patches from the debian package

fix some segfault when playing with unicode character (pidgin crash often when a lot of binary character is set in name)
see https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/28640
patches/glibc-2.3.6/glibc-2.3.6-cvs-regcomp_c.patch
patches/glibc-2.3.6/glibc-2.3.6-cvs-sqrt.patch
patches/glibc-2.3.6/glibc-2.3.6-forward-backward-collation.patch
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc-2.3.6/glibc-2.3.6-cvs-regcomp_c.patch	Thu Feb 14 18:27:12 2008 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +CVSROOT:	/cvs/glibc
     1.5 +Module name:	libc
     1.6 +Changes by:	drepper@sources.redhat.com	2005-07-10 22:01:15
     1.7 +
     1.8 +Modified files:
     1.9 +	posix          : regcomp.c 
    1.10 +
    1.11 +Log message:
    1.12 +	(re_compile_internal): Call __libc_lock_init after init_dfa.
    1.13 +
    1.14 +===================================================================
    1.15 +RCS file: /cvs/glibc/libc/posix/regcomp.c,v
    1.16 +retrieving revision 1.95
    1.17 +retrieving revision 1.96
    1.18 +diff -u -r1.95 -r1.96
    1.19 +--- libc/posix/regcomp.c	2005/05/06 23:33:52	1.95
    1.20 ++++ libc/posix/regcomp.c	2005/07/10 22:01:14	1.96
    1.21 +@@ -774,8 +774,6 @@
    1.22 +     }
    1.23 +   preg->used = sizeof (re_dfa_t);
    1.24 + 
    1.25 +-  __libc_lock_init (dfa->lock);
    1.26 +-
    1.27 +   err = init_dfa (dfa, length);
    1.28 +   if (BE (err != REG_NOERROR, 0))
    1.29 +     {
    1.30 +@@ -789,6 +787,8 @@
    1.31 +   strncpy (dfa->re_str, pattern, length + 1);
    1.32 + #endif
    1.33 + 
    1.34 ++  __libc_lock_init (dfa->lock);
    1.35 ++
    1.36 +   err = re_string_construct (&regexp, pattern, length, preg->translate,
    1.37 + 			     syntax & RE_ICASE, dfa);
    1.38 +   if (BE (err != REG_NOERROR, 0))
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/patches/glibc-2.3.6/glibc-2.3.6-cvs-sqrt.patch	Thu Feb 14 18:27:12 2008 +0100
     2.3 @@ -0,0 +1,63 @@
     2.4 +2005-10-13  Ulrich Drepper  <drepper@redhat.com>
     2.5 +
     2.6 +        [BZ #1466]
     2.7 +        * sysdeps/generic/s_csqrt.c (__csqrt): For zero real part, return
     2.8 +        principal square root.
     2.9 +        * sysdeps/generic/s_csqrtf.c (__csqrtf): Likewise.
    2.10 +        * sysdeps/generic/s_csqrtl.c (__csqrtl): Likewise.
    2.11 +
    2.12 +===================================================================
    2.13 +RCS file: /cvs/glibc/libc/sysdeps/generic/s_csqrt.c,v
    2.14 +retrieving revision 1.2
    2.15 +retrieving revision 1.3
    2.16 +diff -u -r1.2 -r1.3
    2.17 +--- libc/sysdeps/generic/s_csqrt.c	2001/07/06 04:55:49	1.2
    2.18 ++++ libc/sysdeps/generic/s_csqrt.c	2005/10/13 19:05:44	1.3
    2.19 +@@ -79,8 +79,8 @@
    2.20 + 	{
    2.21 + 	  double r = __ieee754_sqrt (0.5 * fabs (__imag__ x));
    2.22 + 
    2.23 +-	  __real__ res = __copysign (r, __imag__ x);
    2.24 +-	  __imag__ res = r;
    2.25 ++	  __real__ res = r;
    2.26 ++	  __imag__ res = __copysign (r, __imag__ x);
    2.27 + 	}
    2.28 +       else
    2.29 + 	{
    2.30 +
    2.31 +===================================================================
    2.32 +RCS file: /cvs/glibc/libc/sysdeps/generic/s_csqrtl.c,v
    2.33 +retrieving revision 1.2
    2.34 +retrieving revision 1.3
    2.35 +diff -u -r1.2 -r1.3
    2.36 +--- libc/sysdeps/generic/s_csqrtl.c	2001/07/06 04:55:49	1.2
    2.37 ++++ libc/sysdeps/generic/s_csqrtl.c	2005/10/13 19:04:31	1.3
    2.38 +@@ -79,8 +79,8 @@
    2.39 + 	{
    2.40 + 	  long double r = __ieee754_sqrtl (0.5 * fabsl (__imag__ x));
    2.41 + 
    2.42 +-	  __real__ res = __copysignl (r, __imag__ x);
    2.43 +-	  __imag__ res = r;
    2.44 ++	  __real__ res = r;
    2.45 ++	  __imag__ res = __copysignl (r, __imag__ x);
    2.46 + 	}
    2.47 +       else
    2.48 + 	{
    2.49 +===================================================================
    2.50 +RCS file: /cvs/glibc/libc/sysdeps/generic/s_csqrtf.c,v
    2.51 +retrieving revision 1.3
    2.52 +retrieving revision 1.4
    2.53 +diff -u -r1.3 -r1.4
    2.54 +--- libc/sysdeps/generic/s_csqrtf.c	2004/01/13 09:08:04	1.3
    2.55 ++++ libc/sysdeps/generic/s_csqrtf.c	2005/10/13 19:05:12	1.4
    2.56 +@@ -79,8 +79,8 @@
    2.57 + 	{
    2.58 + 	  float r = __ieee754_sqrtf (0.5 * fabsf (__imag__ x));
    2.59 + 
    2.60 +-	  __real__ res = __copysignf (r, __imag__ x);
    2.61 +-	  __imag__ res = r;
    2.62 ++	  __real__ res = r;
    2.63 ++	  __imag__ res = __copysignf (r, __imag__ x);
    2.64 + 	}
    2.65 +       else
    2.66 + 	{
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/patches/glibc-2.3.6/glibc-2.3.6-forward-backward-collation.patch	Thu Feb 14 18:27:12 2008 +0100
     3.3 @@ -0,0 +1,96 @@
     3.4 +# DP: Description: Fix segfault when strings contain a mix of forward
     3.5 +#     and backward rules.
     3.6 +# DP: Related bugs: #310635 BZ645
     3.7 +# DP: Dpatch Author: Denis Barbier <barbier@linuxfr.org>
     3.8 +# DP: Patch Author: Denis Barbier
     3.9 +# DP: Upstream status: fix in strxfrm_l.c has been committed upstream
    3.10 +# DP:                  and strcoll_l.c has not been submitted yet.
    3.11 +# DP: Test case: the following command segfaults in en_US.UTF-8 locale
    3.12 +# DP:            when BZ645 is fixed:
    3.13 +# DP:                echo 2d d194 0a 2d d194 0a | xxd -r -p | sort
    3.14 +# DP: Date: 2006-03-17
    3.15 +
    3.16 +Index: glibc-2.3.6/string/strxfrm_l.c
    3.17 +===================================================================
    3.18 +--- glibc-2.3.6.orig/string/strxfrm_l.c
    3.19 ++++ glibc-2.3.6/string/strxfrm_l.c
    3.20 +@@ -1,4 +1,4 @@
    3.21 +-/* Copyright (C) 1995,96,97,2002, 2004 Free Software Foundation, Inc.
    3.22 ++/* Copyright (C) 1995,96,97,2002, 2004, 2005 Free Software Foundation, Inc.
    3.23 +    This file is part of the GNU C Library.
    3.24 +    Written by Ulrich Drepper <drepper@gnu.org>, 1995.
    3.25 + 
    3.26 +@@ -210,8 +210,9 @@
    3.27 + 		      /* Handle the pushed elements now.  */
    3.28 + 		      size_t backw;
    3.29 + 
    3.30 +-		      for (backw = idxcnt - 1; backw >= backw_stop; --backw)
    3.31 ++		      for (backw = idxcnt; backw > backw_stop; )
    3.32 + 			{
    3.33 ++			  --backw;
    3.34 + 			  len = weights[idxarr[backw]++];
    3.35 + 
    3.36 + 			  if (needed + len < n)
    3.37 +@@ -293,8 +294,9 @@
    3.38 + 		     /* Handle the pushed elements now.  */
    3.39 + 		      size_t backw;
    3.40 + 
    3.41 +-		      for (backw = idxcnt - 1; backw >= backw_stop; --backw)
    3.42 ++		      for (backw = idxcnt; backw > backw_stop; )
    3.43 + 			{
    3.44 ++			  --backw;
    3.45 + 			  len = weights[idxarr[backw]++];
    3.46 + 			  if (len != 0)
    3.47 + 			    {
    3.48 +Index: glibc-2.3.6/string/strcoll_l.c
    3.49 +===================================================================
    3.50 +--- glibc-2.3.6.orig/string/strcoll_l.c
    3.51 ++++ glibc-2.3.6/string/strcoll_l.c
    3.52 +@@ -186,7 +186,10 @@
    3.53 + 		    /* The last pushed character was handled.  Continue
    3.54 + 		       with forward characters.  */
    3.55 + 		    if (idx1cnt < idx1max)
    3.56 +-		      idx1now = idx1cnt;
    3.57 ++		      {
    3.58 ++			idx1now = idx1cnt;
    3.59 ++			backw1_stop = ~0ul;
    3.60 ++		      }
    3.61 + 		    else
    3.62 + 		      /* Nothing anymore.  The backward sequence ended with
    3.63 + 			 the last sequence in the string.  Note that seq1len
    3.64 +@@ -245,7 +248,10 @@
    3.65 + 		    /* The last pushed character was handled.  Continue
    3.66 + 		       with forward characters.  */
    3.67 + 		    if (idx2cnt < idx2max)
    3.68 +-		      idx2now = idx2cnt;
    3.69 ++		      {
    3.70 ++			idx2now = idx2cnt;
    3.71 ++			backw2_stop = ~0ul;
    3.72 ++		      }
    3.73 + 		    else
    3.74 + 		      /* Nothing anymore.  The backward sequence ended with
    3.75 + 			 the last sequence in the string.  Note that seq2len
    3.76 +@@ -370,7 +376,10 @@
    3.77 + 			/* The last pushed character was handled.  Continue
    3.78 + 			   with forward characters.  */
    3.79 + 			if (idx1cnt < idx1max)
    3.80 +-			  idx1now = idx1cnt;
    3.81 ++			  {
    3.82 ++			    idx1now = idx1cnt;
    3.83 ++			    backw1_stop = ~0ul;
    3.84 ++			  }
    3.85 + 			else
    3.86 + 			  {
    3.87 + 			    /* Nothing anymore.  The backward sequence
    3.88 +@@ -426,7 +435,10 @@
    3.89 + 			/* The last pushed character was handled.  Continue
    3.90 + 			   with forward characters.  */
    3.91 + 			if (idx2cnt < idx2max)
    3.92 +-			  idx2now = idx2cnt;
    3.93 ++			  {
    3.94 ++			    idx2now = idx2cnt;
    3.95 ++			    backw2_stop = ~0ul;
    3.96 ++			  }
    3.97 + 			else
    3.98 + 			  {
    3.99 + 			    /* Nothing anymore.  The backward sequence