diff options
author | jilles <jilles@FreeBSD.org> | 2016-03-28 18:58:40 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2016-03-28 18:58:40 +0000 |
commit | a90ad707c5487d6270fc478806ed335203056526 (patch) | |
tree | 11c5a13a8b14c23575e92ba15e8d7ebe8561772f /bin/sh/tests/builtins/trap17.0 | |
parent | 2d884a83b2752861330ec6b2172e81b6c478fd17 (diff) | |
download | FreeBSD-src-a90ad707c5487d6270fc478806ed335203056526.zip FreeBSD-src-a90ad707c5487d6270fc478806ed335203056526.tar.gz |
sh: Fix use-after-free if a trap replaces itself.
MFC after: 1 week
Diffstat (limited to 'bin/sh/tests/builtins/trap17.0')
-rw-r--r-- | bin/sh/tests/builtins/trap17.0 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/sh/tests/builtins/trap17.0 b/bin/sh/tests/builtins/trap17.0 new file mode 100644 index 0000000..89be893 --- /dev/null +++ b/bin/sh/tests/builtins/trap17.0 @@ -0,0 +1,10 @@ +# $FreeBSD$ +# This use-after-free bug probably needs non-default settings to show up. + +v1=nothing v2=nothing +trap 'trap "echo bad" USR1 +v1=trap_received +v2=trap_invoked +:' USR1 +kill -USR1 "$$" +[ "$v1.$v2" = trap_received.trap_invoked ] |