git.schokokeks.org
Repositories
Help
Report an Issue
keks-overlay.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
ec27e9a
Branches
Tags
master
keks-overlay.git
app-shells
bash
files
bash-4.0-negative-return.patch
bash security emergency update
Hanno Böck
commited
ec27e9a
at 2014-09-24 16:52:57
bash-4.0-negative-return.patch
Blame
History
Raw
http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00158.html make `return` accept negative values again hack by me (vapier@gentoo.org) ... i'm not familiar with bash source code, so i imagine this isn't the best way to do it ... --- bash/builtins/return.def +++ bash/builtins/return.def @@ -60,9 +60,23 @@ return_builtin (list) WORD_LIST *list; { + int neg = 0; + if (list && list->word && list->word->word) { + char *word = list->word->word; + if (*word == '-') { + while (*word++) + if (!isdigit(*word)) + break; + if (!*word) + neg = 1; + } + } + + if (!neg) { if (no_options (list)) return (EX_USAGE); list = loptend; /* skip over possible `--' */ + } return_catch_value = get_exitstat (list);