Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh 5.0.5-dev-2



On Aug 16,  8:35am, Han Pingtian wrote:
}
} I have tried PATH_MAX*3 and PATH_MAX*3 - 1, they both can fix the
} buffer overflow here. I also tried PATH_MAX*2 + 1/2/3, they don't 
} fix this problem. 

I suspect Fortify is reporting a potential error rather than a real
one, because we'd presumably have seen other problems before this if
"cd .." actually caused an 8kb buffer on the stack to overflow.

The whole symlink-chasing code is probably ripe to be rewritten with
zsh-heap (or even malloc + static pointers) allocation unless we have
reason to beleive that's a serious performance issue.

For the nonce I'll just commit xbuf2[PATH_MAX*3].

-- 
Barton E. Schaefer



Messages sorted by: Reverse Date, Date, Thread, Author