1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 09:21:50 -05:00

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
This commit is contained in:
Daniel Stenberg 2020-05-28 16:32:07 +02:00
parent 3a2ca60d6a
commit 2110b996a6
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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