From 8ff7ef1aba0e14031c71eb69453a722887a24729 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 18 Feb 2023 12:07:54 -0700 Subject: [PATCH] sudoers: fix build with --sanitizer none (#9751) A space was being removed from CFLAGS when SANITIZER_FLAGS was empty, resulting in a build error. --- projects/sudoers/build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/projects/sudoers/build.sh b/projects/sudoers/build.sh index d157c9a63..30b90086c 100755 --- a/projects/sudoers/build.sh +++ b/projects/sudoers/build.sh @@ -20,13 +20,16 @@ env # Some of the sanitizer flags cause issues with configure tests. # 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//\"`" sanitizer_opts="$COVERAGE_FLAGS" -else +elif [ -n "$SANITIZER_FLAGS" ]; then CFLAGS="`echo \"$CFLAGS\" | sed \"s/ $SANITIZER_FLAGS//\"`" sanitizer_opts="$SANITIZER_FLAGS" +else + sanitizer_opts=no fi + # This is already added by --enable-fuzzer CFLAGS="`echo \"$CFLAGS\" | sed 's/ -fsanitize=fuzzer-no-link//'`"