This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.13-104-g00ee369
- From: drepper at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 3 May 2011 17:44:46 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.13-104-g00ee369
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 00ee369c1cbdcc4ca4a009e9223799951c6c8f04 (commit)
from 1bfbe0d335d3fc44a492648b974a0db19975f6d8 (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=00ee369c1cbdcc4ca4a009e9223799951c6c8f04
commit 00ee369c1cbdcc4ca4a009e9223799951c6c8f04
Author: Andreas Schwab <schwab@redhat.com>
Date: Tue May 3 13:44:25 2011 -0400
ldconfig: don't crash on empty path in config file
diff --git a/ChangeLog b/ChangeLog
index bd08c7d..e90eaa9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-05-03 Andreas Schwab <schwab@redhat.com>
+
+ * elf/ldconfig.c (add_dir): Don't crash on empty path.
+
2011-04-28 Maciej Babinski <mbabinski@google.com>
[BZ #12714]
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 1b2eaa3..751b49b 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -384,14 +384,17 @@ add_dir (const char *line)
}
/* Canonify path: for now only remove leading and trailing
- whitespace and the trailing slashes slashes. */
- i = strlen (entry->path) - 1;
+ whitespace and the trailing slashes. */
+ i = strlen (entry->path);
- while (isspace (entry->path[i]) && i > 0)
- entry->path[i--] = '\0';
+ while (i > 0 && isspace (entry->path[i - 1]))
+ entry->path[--i] = '\0';
- while (entry->path[i] == '/' && i > 0)
- entry->path[i--] = '\0';
+ while (i > 0 && entry->path[i - 1] == '/')
+ entry->path[--i] = '\0';
+
+ if (i == 0)
+ return;
char *path = entry->path;
if (opt_chroot)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 ++++
elf/ldconfig.c | 15 +++++++++------
2 files changed, 13 insertions(+), 6 deletions(-)
hooks/post-receive
--
GNU C Library master sources