From: Ulrich Drepper Date: Sat, 29 Oct 2011 16:43:18 +0000 (-0400) Subject: Cleanups in ldconfig's chroot handling X-Git-Tag: glibc-2.15~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d272e7f19dc2dae6d215f6ca6512d042575ed736;p=thirdparty%2Fglibc.git Cleanups in ldconfig's chroot handling --- diff --git a/ChangeLog b/ChangeLog index fbef6bc6c34..d5d7cb5c74f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2011-10-29 Ulrich Drepper + * elf/chroot_canon.c (chroot_canon): Cleanups. + * elf/dl-lookup.c (_dl_setup_hash): Avoid warning. [BZ #13335] diff --git a/elf/chroot_canon.c b/elf/chroot_canon.c index b639cfa82dc..f8f33704930 100644 --- a/elf/chroot_canon.c +++ b/elf/chroot_canon.c @@ -70,7 +70,6 @@ chroot_canon (const char *chroot, const char *name) for (start = end = name; *start; start = end) { struct stat64 st; - int n; /* Skip sequence of multiple path-separators. */ while (*start == '/') @@ -135,7 +134,7 @@ chroot_canon (const char *chroot, const char *name) goto error; } - n = readlink (rpath, buf, PATH_MAX - 1); + ssize_t n = readlink (rpath, buf, PATH_MAX - 1); if (n < 0) { if (*end == '\0') @@ -148,7 +147,7 @@ chroot_canon (const char *chroot, const char *name) extra_buf = alloca (PATH_MAX); len = strlen (end); - if ((long int) (n + len) >= PATH_MAX) + if (len >= PATH_MAX - n) { __set_errno (ENAMETOOLONG); goto error;