diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 15:09:50 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 15:09:50 +0000 |
commit | 2c9837f613823cdde9ff4786b38cc06c6ac65735 (patch) | |
tree | e2895dcf64c77dd71c2387d760c3deb21394db03 | |
parent | e9ca1d1e4687b5349ce494c9385a902b3a4b658a (diff) | |
download | glibc-2c9837f613823cdde9ff4786b38cc06c6ac65735.tar glibc-2c9837f613823cdde9ff4786b38cc06c6ac65735.tar.gz glibc-2c9837f613823cdde9ff4786b38cc06c6ac65735.tar.bz2 glibc-2c9837f613823cdde9ff4786b38cc06c6ac65735.zip |
2007-04-13 Jakub Jelinek <jakub@redhat.com>
[BZ #4344]
* elf/ldconfig.c (search_dir): Fix 2 off-by-2 errors.
Reported by David Anderson <davea42@earthlink.net>.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | elf/ldconfig.c | 8 |
2 files changed, 10 insertions, 4 deletions
@@ -1,5 +1,11 @@ 2007-04-13 Jakub Jelinek <jakub@redhat.com> + [BZ #4344] + * elf/ldconfig.c (search_dir): Fix 2 off-by-2 errors. + Reported by David Anderson <davea42@earthlink.net>. + +2007-04-13 Jakub Jelinek <jakub@redhat.com> + * stdio-common/printf_fp.c (___printf_fp): Fix exponent -4 special case handling when wcp == wstartp + 1. Fix a comment typo. * stdio-common/tfformat.c (sprint_doubles): Add a new testcase. diff --git a/elf/ldconfig.c b/elf/ldconfig.c index 5b9a5b1744..7fdbe9da2c 100644 --- a/elf/ldconfig.c +++ b/elf/ldconfig.c @@ -706,10 +706,10 @@ search_dir (const struct dir_entry *entry) + 1, ".#prelink#.", sizeof (".#prelink#.") - 1) == 0) continue; } - len += strlen (entry->path); + len += strlen (entry->path) + 2; if (len > file_name_len) { - file_name_len = len + 1; + file_name_len = len; file_name = alloca (file_name_len); if (!opt_chroot) real_file_name = file_name; @@ -717,10 +717,10 @@ search_dir (const struct dir_entry *entry) sprintf (file_name, "%s/%s", entry->path, direntry->d_name); if (opt_chroot) { - len = strlen (dir_name) + strlen (direntry->d_name); + len = strlen (dir_name) + strlen (direntry->d_name) + 2; if (len > real_file_name_len) { - real_file_name_len = len + 1; + real_file_name_len = len; real_file_name = alloca (real_file_name_len); } sprintf (real_file_name, "%s/%s", dir_name, direntry->d_name); |