mirror of
https://github.com/stefanberger/libtpms
synced 2025-08-23 16:01:32 +00:00

Restrict the number of command line parameters passed to the fuzz program in order not to overstep command line parameter size restrictions. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
20 lines
382 B
Bash
Executable File
20 lines
382 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
TESTDIR=${abs_top_testdir:-$(dirname "$0")}
|
|
DIR=${PWD}
|
|
|
|
MAXLINES=128
|
|
l=1
|
|
|
|
corpus=$(ls "$TESTDIR/corpus-execute-command/"*)
|
|
|
|
while :; do
|
|
echo "Passing test cases $l to $((l + MAXLINES))"
|
|
tmp=$(echo "${corpus}" | sed -n "${l},$((l + MAXLINES))p")
|
|
[ -z "${tmp}" ] && exit 0
|
|
${DIR}/fuzz ${tmp}
|
|
rc=$?
|
|
[ $rc -ne 0 ] && exit $rc
|
|
l=$((l + MAXLINES))
|
|
done
|