GNU bug report logs - #17010
Bug#739752: coreutils: ln segfaults when run with --relative and an empty target

Previous Next

Package: coreutils;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Fri, 14 Mar 2014 01:44:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jim Meyering <jim <at> meyering.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#17010: closed (Bug#739752: coreutils: ln segfaults when run
 with --relative and an empty target)
Date: Fri, 14 Mar 2014 16:28:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 14 Mar 2014 09:27:24 -0700
with message-id <CA+8g5KEfO=AgogJAZBY9hNmYnrngf1w-9f1qOE62_5GHJBqy=g <at> mail.gmail.com>
and subject line Re: bug#17010: Bug#739752: coreutils: ln segfaults when run with --relative and an empty target
has caused the debbugs.gnu.org bug report #17010,
regarding Bug#739752: coreutils: ln segfaults when run with --relative and an empty target
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
17010: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17010
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jim Meyering <jim <at> meyering.net>
To: Erik Bernstein <erik <at> fscking.org>, 739752 <at> bugs.debian.org,
 bug-coreutils <at> gnu.org
Cc: Debian Bug Tracking System <submit <at> bugs.debian.org>
Subject: Re: Bug#739752: coreutils: ln segfaults when run with --relative and
 an empty target
Date: Thu, 13 Mar 2014 18:42:30 -0700
[Message part 3 (text/plain, inline)]
On Sat, Feb 22, 2014 at 1:57 AM, Erik Bernstein <erik <at> fscking.org> wrote:
> Package: coreutils
> Version: 8.21-1
> Severity: normal
>
> Hi,
>
> when ln is run with --relative --symbolic and and empty string as the
> target, it ungracefully dies with a segmentation fault. The memory
> violation appears to happen in src/relpath.c:38 when the two input paths
> are checked for leading slashes:
>
>   if ((path1[1] == '/') != (path2[1] == '/'))
>
> How to reproduce:
> [1] Open a terminal
> [2] run: ln -sr '' foobar
>
> Result: segmentation fault  ln -sr '' foobar
> Expected result: Some kind of error message
...

Thank you for the bug report!
That also affected the very latest code in git.
Here is a patch:
[k.txt (text/plain, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Jim Meyering <jim <at> meyering.net>
To: Pádraig Brady <P <at> draigbrady.com>
Cc: Erik Bernstein <erik <at> fscking.org>, 17010 <17010-done <at> debbugs.gnu.org>,
 739752 <739752 <at> bugs.debian.org>
Subject: Re: bug#17010: Bug#739752: coreutils: ln segfaults when run with
 --relative and an empty target
Date: Fri, 14 Mar 2014 09:27:24 -0700
On Fri, Mar 14, 2014 at 4:49 AM, Pádraig Brady <P <at> draigbrady.com> wrote:
...
> Hence since c_f_m() can validly fail even with CAN_MISSING,
> I agree your patch is correct.
>
> Please push.

Done.


This bug report was last modified 11 years and 74 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.