summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorSamuel Cabrero <scabrero@suse.de>2019-06-07 21:12:12 +0200
committerAndreas Schneider <asn@cryptomilk.org>2019-06-11 14:01:20 +0000
commit4646698f1b040e743180b7d43578c31d6a28983e (patch)
tree1e701d47c6aa2bdddad49df49d7bdbad26aa9957 /source3/registry
parent49e2d36918673e7922e4c983809ad1481db63f96 (diff)
downloadsamba-4646698f1b040e743180b7d43578c31d6a28983e.tar.gz
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>
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_parse.c2
1 files changed, 1 insertions, 1 deletions
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;