1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

s3: net: Consider unprocessed in input buffer

If there is unprocessed data in the input buffer (ilen > 0), place new
data read after the unprocessed one.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Samuel Cabrero 2019-06-07 21:12:12 +02:00 committed by Andreas Schneider
parent 49e2d36918
commit 4646698f1b

View File

@ -1016,7 +1016,7 @@ int reg_parse_fd(int fd, const struct reg_parse_callback* cb, const char* opts)
space_to_read = sizeof(buf_in) - ilen;
/* Read the next chunk from the file. */
nread = read(fd, buf_in, space_to_read);
nread = read(fd, buf_in + ilen, space_to_read);
if (nread < 0) {
DBG_ERR("read failed: %s\n", strerror(errno));
ret = -1;