diff options
author | Jilles Tjoelker <jilles@FreeBSD.org> | 2010-05-30 14:20:32 +0000 |
---|---|---|
committer | Jilles Tjoelker <jilles@FreeBSD.org> | 2010-05-30 14:20:32 +0000 |
commit | 5d910070006cd5bf6a1460457b367b5fd6935c72 (patch) | |
tree | 9e2de3ee284decbd9e2f657e05341f7a07d597fa /bin | |
parent | ba02a307fe0a0d5253e0d5559db0b838703622ec (diff) | |
download | src-5d910070006cd5bf6a1460457b367b5fd6935c72.tar.gz src-5d910070006cd5bf6a1460457b367b5fd6935c72.zip |
sh: Fix a crash if a heredoc was not properly ended and parsing continued.
Example (in interactive mode):
cat <<EOF && )
The next command typed caused sh to segfault, because the state for the here
document was not reset.
Like parser_temp, this uses the fact that the parser is not re-entered.
Notes
Notes:
svn path=/head/; revision=208656
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/parser.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c index c9305b38238a..05015d2e6968 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -203,6 +203,7 @@ parsecmd(int interact) * which could happen if we add command substitution on PS1/PS2. */ parser_temp_free_all(); + heredoclist = NULL; tokpushback = 0; doprompt = interact; |