r3781 - in glibc-package/trunk/debian: . patches patches/any
Author: aurel32
Date: 2009-08-25 14:09:19 +0000 (Tue, 25 Aug 2009)
New Revision: 3781
Added:
glibc-package/trunk/debian/patches/any/cvs-unsetenv.diff
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/patches/series
Log:
* cvs-unsetenv.diff: new patch to not segfault in unsetenv() if run after
clearenv().
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2009-08-23 21:29:53 UTC (rev 3780)
+++ glibc-package/trunk/debian/changelog 2009-08-25 14:09:19 UTC (rev 3781)
@@ -4,11 +4,13 @@
* alpha/submitted-sock_nonblock.diff, hppa/submitted-sock_nonblock.diff:
create the files at the correct location. Closes: bug#540871.
* Use the full triplet for optimized and biarch packages.
+ * cvs-unsetenv.diff: new patch to not segfault in unsetenv() if run after
+ clearenv().
[ Samuel Thibault ]
* Convert config_os' gnu-gnu into gnu to fix multiarch paths.
- -- Aurelien Jarno <aurel32@debian.org> Sun, 23 Aug 2009 16:56:09 +0200
+ -- Aurelien Jarno <aurel32@debian.org> Tue, 25 Aug 2009 16:08:24 +0200
eglibc (2.9-25) unstable; urgency=low
Added: glibc-package/trunk/debian/patches/any/cvs-unsetenv.diff
===================================================================
--- glibc-package/trunk/debian/patches/any/cvs-unsetenv.diff (rev 0)
+++ glibc-package/trunk/debian/patches/any/cvs-unsetenv.diff 2009-08-25 14:09:19 UTC (rev 3781)
@@ -0,0 +1,43 @@
+2008-12-01 Ulrich Drepper <drepper@redhat.com>
+
+ * stdlib/setenv.c (unsetenv): Don't search environment if it does
+ not exist.
+
+diff --git a/stdlib/setenv.c b/stdlib/setenv.c
+index 48aaecf..fe591b7 100644
+--- a/stdlib/setenv.c
++++ b/stdlib/setenv.c
+@@ -292,19 +292,20 @@ unsetenv (name)
+ LOCK;
+
+ ep = __environ;
+- while (*ep != NULL)
+- if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
+- {
+- /* Found it. Remove this pointer by moving later ones back. */
+- char **dp = ep;
+-
+- do
+- dp[0] = dp[1];
+- while (*dp++);
+- /* Continue the loop in case NAME appears again. */
+- }
+- else
+- ++ep;
++ if (ep != NULL)
++ while (*ep != NULL)
++ if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
++ {
++ /* Found it. Remove this pointer by moving later ones back. */
++ char **dp = ep;
++
++ do
++ dp[0] = dp[1];
++ while (*dp++);
++ /* Continue the loop in case NAME appears again. */
++ }
++ else
++ ++ep;
+
+ UNLOCK;
+
Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series 2009-08-23 21:29:53 UTC (rev 3780)
+++ glibc-package/trunk/debian/patches/series 2009-08-25 14:09:19 UTC (rev 3781)
@@ -218,3 +218,4 @@
any/submitted-tst-cpucount.diff
any/cvs-getaddrinfo-nss-notfound.diff
any/cvs-signalfd-eventfd.diff
+any/cvs-unsetenv.diff
Reply to: