mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Reproducer from @Saikiran-m: | ~# sh -c `perl -e 'print "a"x100000'` | genunix: NOTICE: core_log: sh[1221] core dumped: /var/cores/core.sh.0.1602153496 | Memory fault(coredump) The crash was in trying to decide whether the name was suitable for autoloading as a function on $FPATH. This calls strmatch() to check the name against a regex for valid function name. But the libast regex code is not designed optimally and uses too much recursion, limiting the length of the strings it's able to cope with. src/cmd/ksh93/sh/path.c: path_search(): - Before calling strmatch(), check that the name is shorter than 256 bytes. The maximum length of file names on Linux and macOS is 255 bytes, so an autoload function can't have a name longer than that anyway. src/cmd/ksh93/tests/path.sh: - Add test for this bug. - Tweak 'command -x' test to not leave a hanging process on Ctrl+C. Fixes: https://github.com/ksh93/ksh/issues/144 |
||
|---|---|---|
| .. | ||
| cmd | ||
| lib | ||
| Mamfile | ||