Skip to content

Commit 35208f7

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

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/playTests.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,15 @@ 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"
312+
readelf -lW "$ZSTD_BIN" | grep 'GNU_STACK .* RW ' || die "zstd binary has executable stack!"
313+
fi
314+
fi
315+
307316
println "\n===> zstdgrep tests"
308317
ln -sf "$ZSTD_BIN" zstdcat
309318
rm -f tmp_grep

0 commit comments

Comments
 (0)