summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/tests
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-12-17 19:24:59 +0000
committerKarl Berry <karl@freefriends.org>2019-12-17 19:24:59 +0000
commit4c124f70e22deecce385bd0164cabbc6e1946fe0 (patch)
treed99dfcf4c332926784b2fba80f83698b6b85ad9c /Build/source/texk/web2c/tests
parent10a7ffb1a8491cbb46e496c3aad5ef20a8cb4217 (diff)
avoid closing already-closed \openout file
git-svn-id: svn://tug.org/texlive/trunk@53155 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/tests')
-rwxr-xr-xBuild/source/texk/web2c/tests/tex-closeout.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/tests/tex-closeout.test b/Build/source/texk/web2c/tests/tex-closeout.test
new file mode 100755
index 00000000000..c510313fa61
--- /dev/null
+++ b/Build/source/texk/web2c/tests/tex-closeout.test
@@ -0,0 +1,19 @@
+#! /bin/sh -vx
+# $Id$
+# Copyright 2019 Karl Berry <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+# in case we're invoked standalone instead of from make.
+test -z "$srcdir" && srcdir=`cd \`dirname $0\`/.. && pwd` # web2c/
+TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
+
+# Resulted in a double free with glibc on x86_64-linux.
+fail=2
+./tex -ini '\batchmode \immediate\openout1=b \openout1=/tmp/a \end'
+
+# If TeX crashed, we won't get here. The exit status will be something
+# like 134 on GNU/Linux, but we don't want to rely on that.
+fail=0
+
+exit $fail
+