curl: prevent binary output spewed to terminal

... unless "--output -" is used. Binary detection is done by simply
checking for a binary zero in early data.

Added test 1425 1426 to verify.

Closes #1512
This commit is contained in:
Daniel Stenberg 2017-06-16 11:30:36 +02:00
parent ce2cc568f8
commit 5385450afd
10 changed files with 47 additions and 17 deletions

View file

@ -252,7 +252,7 @@ static const struct helptxt helptext[] = {
"Use HTTP NTLM authentication"},
{" --ntlm-wb",
"Use HTTP NTLM authentication with winbind"},
{" --oauth2-bearer",
{" --oauth2-bearer <token>",
"OAuth 2 Bearer Token"},
{"-o, --output <file>",
"Write to file instead of stdout"},