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

Re: Obscure overflow with very long path; completion



On May 8, 10:41am, Geoff Wing wrote:
} Subject: Re: Obscure overflow with very long path; completion
}
} On Saturday 2005-05-07 16:23 +1000, Bart Schaefer output:
} :Try this patch?
} 
} Quick response.  Haven't investigated.
} 
} % cd /tmp
} % for I in {1..100}; mkdir aaaaaaaaaaaaaaaaaaaa && cd aaaaaaaaaaaaaaaaaaaa
} MEM: allocation error at sbrk.
} zsh: fatal error: out of memory

Hmm.

I finally had a chance to gdb-trace this, and although I only get it to
crash -- in finddir() -- with 500 levels of directory and only when I
"setopt chaselinks", I think my patch is incomplete even for xsymlinks().

Potential problems are in:

zexecve		exec.c 357		via exec.c 590
execute		exec.c 560
findcmd		exec.c 643		(if $path contains a long path)
xsymlinks	utils.c 340
finddir		utils.c 500

There are a number of other places that use PATH_MAX, but they all seem
(from examination, not rigorous testing) to check for overflow.



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