summary refs log tree commit diff
path: root/src/trap.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2018-12-14 13:44:14 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2019-02-25 12:51:53 +0800
commit2bc6caace3b08024955ed57fc993d91067f883a1 (patch)
tree99bd8ae3035ad029b758a2e9471c8710f487ddae /src/trap.c
parentsystem: Disable glibc warning on sigsetmask (diff)
downloaddash-2bc6caace3b08024955ed57fc993d91067f883a1.tar.gz
dash-2bc6caace3b08024955ed57fc993d91067f883a1.zip
eval: avoid leaking memory associated with redirections
The following constructs result in ever-increasing memory usage:

  while true; do { true; } </dev/null; done
  while true; do ( true; ) </dev/null; done

For comparison, bash displays static memory usage in both cases.

This issue was reported for BusyBox ash which is derived from dash:

  https://bugs.busybox.net/show_bug.cgi?id=7748

Signed-off-by: Ron Yorston <rmy@frippery.org>

I have simplified evaltree so that it simply sets the stack mark
unconditionally.  This allows us to remove the stack marks in the
functions called by evaltree.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions