mirror of
https://github.com/opnsense/src.git
synced 2026-02-25 19:05:20 -05:00
If an ; or & token was followed by an EOF token, pending here-documents were left uninitialized. Execution would crash, either in the main shell process for literal here-documents or in a child process for expanded here-documents. In the latter case the problem is hard to detect apart from the core dumps and log messages. Side effect: slightly different retries on inputs where EOF is not persistent. Note that tools/regression/bin/sh/parser/heredoc6.0 still causes a similar crash in a child process. The text passed to eval is malformed and should be rejected.
19 lines
479 B
Text
19 lines
479 B
Text
# $FreeBSD$
|
|
|
|
# Some of these created malformed parse trees with null pointers for here
|
|
# documents, causing the here document writing process to segfault.
|
|
eval ': <<EOF'
|
|
eval ': <<EOF;'
|
|
eval '`: <<EOF`'
|
|
eval '`: <<EOF;`'
|
|
eval '`: <<EOF`;'
|
|
eval '`: <<EOF;`;'
|
|
|
|
# Some of these created malformed parse trees with null pointers for here
|
|
# documents, causing sh to segfault.
|
|
eval ': <<\EOF'
|
|
eval ': <<\EOF;'
|
|
eval '`: <<\EOF`'
|
|
eval '`: <<\EOF;`'
|
|
eval '`: <<\EOF`;'
|
|
eval '`: <<\EOF;`;'
|