sudoers: fix build with --sanitizer none (#9751)

A space was being removed from CFLAGS when SANITIZER_FLAGS was empty,
resulting in a build error.
This commit is contained in:
Todd C. Miller 2023-02-18 12:07:54 -07:00 committed by GitHub
parent 51983f932e
commit 8ff7ef1aba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -20,13 +20,16 @@ env
# Some of the sanitizer flags cause issues with configure tests. # Some of the sanitizer flags cause issues with configure tests.
# Pull them out of CFLAGS and pass them to configure instead. # Pull them out of CFLAGS and pass them to configure instead.
if [ $SANITIZER == "coverage" ]; then if [ $SANITIZER == "coverage" -a -n "$COVERAGE_FLAGS" ]; then
CFLAGS="`echo \"$CFLAGS\" | sed \"s/ $COVERAGE_FLAGS//\"`" CFLAGS="`echo \"$CFLAGS\" | sed \"s/ $COVERAGE_FLAGS//\"`"
sanitizer_opts="$COVERAGE_FLAGS" sanitizer_opts="$COVERAGE_FLAGS"
else elif [ -n "$SANITIZER_FLAGS" ]; then
CFLAGS="`echo \"$CFLAGS\" | sed \"s/ $SANITIZER_FLAGS//\"`" CFLAGS="`echo \"$CFLAGS\" | sed \"s/ $SANITIZER_FLAGS//\"`"
sanitizer_opts="$SANITIZER_FLAGS" sanitizer_opts="$SANITIZER_FLAGS"
else
sanitizer_opts=no
fi fi
# This is already added by --enable-fuzzer # This is already added by --enable-fuzzer
CFLAGS="`echo \"$CFLAGS\" | sed 's/ -fsanitize=fuzzer-no-link//'`" CFLAGS="`echo \"$CFLAGS\" | sed 's/ -fsanitize=fuzzer-no-link//'`"