1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

lib: Fix file_ploadv_send()/_recv()

When reading more than 1024 bytes, don't insert '\0' bytes in between
those chunks.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
This commit is contained in:
Volker Lendecke 2021-01-26 16:39:29 +01:00
parent 7528b7886b
commit 230a89332f

View File

@ -105,6 +105,13 @@ static void file_ploadv_readable(struct tevent_req *subreq)
}
bufsize = talloc_get_size(state->buf);
if (bufsize > 0) {
/*
* Last round we've added the trailing '\0'. Remove it
* for this round.
*/
bufsize -= 1;
}
if (((bufsize + nread) < bufsize) ||
((bufsize + nread + 1) < bufsize)) {