]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
configure: repair the check if argv can be written to
authorDaniel Stenberg <daniel@haxx.se>
Thu, 28 May 2020 14:32:07 +0000 (16:32 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 28 May 2020 21:33:56 +0000 (23:33 +0200)
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

index 0c1decc7243eba6542db91a55dfd88f7807c6c63..8161eee947c4ca8ae33ef4b8aad472d3bcc800c6 100755 (executable)
@@ -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