]> git.ipfire.org Git - thirdparty/coreutils.git/commit
ln: with -sr, don't segfault for a TARGET of ''
authorJim Meyering <meyering@fb.com>
Fri, 14 Mar 2014 00:05:04 +0000 (17:05 -0700)
committerJim Meyering <meyering@fb.com>
Fri, 14 Mar 2014 03:05:10 +0000 (20:05 -0700)
commit0093ac8d57a0f1a16fd09d98f6a524dddb6053e7
treebe5995a36e912c3881b1651c1e1a420142129560
parent4f211822dddd1777dc915f2df4e2ed3b65c68301
ln: with -sr, don't segfault for a TARGET of ''

Prior to this change, "ln -sr '' F" would segfault, attempting
to read path2[1] in relpath.c's path_common_prefix function.
This problem arises whenever canonicalize_filename_mode returns
NULL.
* src/ln.c (convert_abs_rel): Call relpath only when
both canonicalize_filename_mode calls return non-NULL.
* tests/ln/relative.sh: Add a test to trigger this failure.
* THANKS.in: List reporter's name/address.
* NEWS (Bug fixes): Mention it.
Reported by Erik Bernstein in 739752@bugs.debian.org.
Fixes http://bugs.gnu.org/17010.
NEWS
THANKS.in
src/ln.c
tests/ln/relative.sh