Skip to content

Commit 35652b0

Browse files
committed
Add Test Validating Stack is not Executable in playTests.sh
1 parent 9a9d1ec commit 35652b0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/playTests.sh

+8
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,14 @@ zstd -d -f tmp_corrupt.zst --no-check
304304
zstd -d -f tmp_corrupt.zst --check --no-check # final flag overrides
305305
zstd -d -f tmp.zst --no-check
306306

307+
if [ "$isWindows" = false ]; then
308+
if [ -n "$(which readelf)" ]; then
309+
println "test: check if binary has executable stack"
310+
file "$ZSTD_BIN"
311+
readelf -lW "$ZSTD_BIN" | grep 'GNU_STACK .* RW ' || die "zstd binary has executable stack!"
312+
fi
313+
fi
314+
307315
println "\n===> zstdgrep tests"
308316
ln -sf "$ZSTD_BIN" zstdcat
309317
rm -f tmp_grep

0 commit comments

Comments
 (0)