From: Samuel Cabrero Date: Fri, 7 Jun 2019 19:12:12 +0000 (+0200) Subject: s3: net: Consider unprocessed in input buffer X-Git-Tag: ldb-2.0.5~406 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4646698f1b040e743180b7d43578c31d6a28983e;p=thirdparty%2Fsamba.git 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 Reviewed-by: Guenther Deschner Reviewed-by: Andreas Schneider --- diff --git a/source3/registry/reg_parse.c b/source3/registry/reg_parse.c index c64cf66a5ab..24e9b62a516 100644 --- a/source3/registry/reg_parse.c +++ b/source3/registry/reg_parse.c @@ -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;