From 2110b996a6e9b8271d381c4204b5b930b762dc58 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 28 May 2020 16:32:07 +0200 Subject: configure: repair the check if argv can be written to Due to bad escaping of the test code, the test wouldn't build and thus result in a negative test result, which would lead to the unconditional assumption that overwriting the arguments doesn't work and thus curl would never hide credentials given in the command line, even when it would otherwise be possible. Regression from commit 2d4c2152c (7.60.0) Reported-by: huzunhao on github Fixes #5470 Closes #5471 --- configure.ac | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 0c1decc72..8161eee94 100755 --- a/configure.ac +++ b/configure.ac @@ -1282,12 +1282,14 @@ dnl Check if the operating system allows programs to write to their own argv[] dnl ********************************************************************** AC_MSG_CHECKING([if argv can be written to]) -CURL_RUN_IFELSE([ -int main(int argc, char ** argv) { - argv[0][0] = ' '; - return (argv[0][0] == ' ')?0:1; +CURL_RUN_IFELSE([[ +int main(int argc, char **argv) +{ + (void)argc; + argv[0][0] = ' '; + return (argv[0][0] == ' ')?0:1; } -],[ +]],[ curl_cv_writable_argv=yes ],[ curl_cv_writable_argv=no -- cgit v1.2.3