Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Wrong PWD with chasedots
- X-seq: zsh-workers 33690
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Wrong PWD with chasedots
- Date: Thu, 13 Nov 2014 19:44:54 +0000
- In-reply-to: <20141113184620.GA2033@mlap.lactee>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20141111103527.GB8974@mlap.lactee> <141111193532.ZM31133@torch.brasslantern.com> <20141113184620.GA2033@mlap.lactee>
On Thu, 13 Nov 2014 19:46:20 +0100
Marc Finet <m.dreadlock@xxxxxxxxx> wrote:
> I had some time to investigate and the problem lies in the
> utils.c::xsymlinks() where there is a discrepancy between the content of
> the global variable xbuf and the local value xbuflen:
> - in the case a symlink is found, xsymlinks() is called,
> - xbuf is updated but not xbuflen in the calling function
> - later, when ".." is found, it is trimmed but uses xbuf + xbuflen as
> starting point, not xbuf + its length. This leads to lose the data
> set by xsymlinks(), i.e. the name of the sub-directories.
> This wrong behavior has been introduced by commit 3e06aeabd8a9e8384ebaa
> "32294: prevent buffer overflow when scanning very long directory paths
> for symbolic links".
>
> So I have two patches. The first one forces the xbuflen synchronization:
Thanks, I've applied this.
> While reading the xsymlinks() function I think that a (ret >= 0)
> condition should be added in the for() loop to exit early. Or a break
> should be added after setting ret to -1 in the case of error after
> symlink is found. Anyway, it's not homogeneous, but I do not know which
> method is 'cleaner'.
And this.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author