Paul Eggert <[EMAIL PROTECTED]> wrote: > While auditing coreutils I noticed a potential buffer overrun in > copy.c on hosts like GNU/Hurd where symbolic links have potentially > unlimited length. Here's a patch. As a nice side effect, this patch > improves the performance of programs on 'ls' on more-ordinary hosts > when they are given long symlinks, as it causes readlink to be invoked > once, rather than twice, when the symlink is long. > > 2004-05-25 Paul Eggert <[EMAIL PROTECTED]> > > Improve the efficiency (and in one case, correctness) of code > that reads symlinks. > > * lib/xreadlink.c: Include xreadlink.h first, to catch .h file > dependency problems. > (xreadlink): Accept new arg SIZE, for efficiency. > All decls and uses changed. > * lib/xreadlink.h: Include <stddef.h>, for size_t. > * src/copy.c (copy_internal): Don't use alloca, as it can mess up > royally if the link length is long (e.g., GNU/Hurd). Use > xreadlink instead, it's safer. Don't bother to read the link if > it's the wrong size. Add a FIXME because this area is a bit murky > and undocumented.
Thanks! Applied. _______________________________________________ Bug-coreutils mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/bug-coreutils