aboutsummaryrefslogtreecommitdiff
path: root/afl-cmin.bash
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-12-10 17:25:22 +0100
committervan Hauser <vh@thc.org>2020-12-10 17:25:22 +0100
commit161c80014ec11e8ae4338da34428c20dcbe03962 (patch)
treeedbce12f99291a82f79291894b2da813275d35b0 /afl-cmin.bash
parentaf403e5872f9ed640e3148105b6731c9a8f48225 (diff)
downloadAFLplusplus-161c80014ec11e8ae4338da34428c20dcbe03962.tar.gz
change search order for afl-showmin in afl-cmin*
Diffstat (limited to 'afl-cmin.bash')
-rwxr-xr-xafl-cmin.bash19
1 files changed, 15 insertions, 4 deletions
diff --git a/afl-cmin.bash b/afl-cmin.bash
index 637949bc..fb50f1fc 100755
--- a/afl-cmin.bash
+++ b/afl-cmin.bash
@@ -132,7 +132,7 @@ For additional tips, please consult README.md.
Environment variables used:
AFL_KEEP_TRACES: leave the temporary <out_dir>\.traces directory
-AFL_PATH: path for the afl-showmap binary
+AFL_PATH: last resort location to find the afl-showmap binary
AFL_SKIP_BIN_CHECK: skip check for target binary
_EOF_
exit 1
@@ -244,10 +244,21 @@ if [ ! "$STDIN_FILE" = "" ]; then
touch "$STDIN_FILE" || exit 1
fi
-if [ "$AFL_PATH" = "" ]; then
- SHOWMAP="${0%/afl-cmin.bash}/afl-showmap"
+SHOWMAP=`command -v afl-showmap 2>/dev/null`
+
+if [ -z "$SHOWMAP" ]; then
+ TMP="${0%/afl-cmin.bash}/afl-showmap"
+ if [ -x "$TMP" ]; then
+ SHOWMAP=$TMP
+ fi
+fi
+
+if [ -z "$SHOWMAP" -a -x "./afl-showmap" ]; then
+ SHOWMAP="./afl-showmap"
else
- SHOWMAP="$AFL_PATH/afl-showmap"
+ if [ -n "$AFL_PATH" ]; then
+ SHOWMAP="$AFL_PATH/afl-showmap"
+ fi
fi
if [ ! -x "$SHOWMAP" ]; then