Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sendf: accept zero-length data in Curl_client_write() #7898

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/sendf.c
Expand Up @@ -608,7 +608,7 @@ static CURLcode chop_write(struct Curl_easy *data,
/* Curl_client_write() sends data to the write callback(s)

The bit pattern defines to what "streams" to write to. Body and/or header.
The defines are in sendf.h of course. "len" is not allowed to be 0.
The defines are in sendf.h of course.

If CURL_DO_LINEEND_CONV is enabled, data is converted IN PLACE to the
local character encoding. This is a problem and should be changed in
Expand All @@ -621,8 +621,10 @@ CURLcode Curl_client_write(struct Curl_easy *data,
{
struct connectdata *conn = data->conn;

DEBUGASSERT(len);
DEBUGASSERT(type <= 3);
DEBUGASSERT(!(type & ~CLIENTWRITE_BOTH));

if(!len)
return CURLE_OK;

/* FTP data may need conversion. */
if((type & CLIENTWRITE_BODY) &&
Expand Down