Skip to content

Commit

Permalink
fuzz: Fix use of PWD variable.
Browse files Browse the repository at this point in the history
The PWD variable is set by bash itself on every cd command,
rename it so it works as expected.
  • Loading branch information
mbroz committed Feb 8, 2025
1 parent a965a88 commit 3899484
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/fuzz/oss-fuzz-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ in_oss_fuzz()
echo "Running cryptsetup OSS-Fuzz build script."
env
set -ex
PWD=$(pwd)
XPWD="$(pwd)"

export LC_CTYPE=C.UTF-8

export SRC=${SRC:-$PWD/build}
export OUT="${OUT:-$PWD/out}"
export SRC="${SRC:-$XPWD/build}"
export OUT="${OUT:-$XPWD/out}"
export DEPS_PATH=$SRC/static_lib_deps

export PKG_CONFIG_PATH="$DEPS_PATH"/lib/pkgconfig
Expand All @@ -36,8 +36,8 @@ mkdir -p $OUT
mkdir -p $DEPS_PATH
cd $SRC

LIBFUZZER_PATCH="$PWD/unpoison-mutated-buffers-from-libfuzzer.patch"
in_oss_fuzz && LIBFUZZER_PATCH="$PWD/cryptsetup/tests/fuzz/unpoison-mutated-buffers-from-libfuzzer.patch"
LIBFUZZER_PATCH="$XPWD/unpoison-mutated-buffers-from-libfuzzer.patch"
in_oss_fuzz && LIBFUZZER_PATCH="$XPWD/cryptsetup/tests/fuzz/unpoison-mutated-buffers-from-libfuzzer.patch"

in_oss_fuzz && apt-get update && apt-get install -y \
make autoconf automake autopoint libtool pkg-config \
Expand Down Expand Up @@ -150,4 +150,4 @@ for fuzzer in $ENABLED_FUZZERS; do
fi
done

cd $PWD
cd $XPWD

0 comments on commit 3899484

Please sign in to comment.