summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2022-07-31 16:55:34 -0700
committerWayne Davison <wayne@opencoder.net>2022-07-31 17:46:34 -0700
commitb7231c7d02cfb65d291af74ff66e7d8c507ee871 (patch)
treed09cf63819fca7c3932c7d605c103048af9fb734 /io.c
parent15c34f0a8c76e250f5487997849ab31e40e556e9 (diff)
downloadrsync-b7231c7d02cfb65d291af74ff66e7d8c507ee871.tar.gz
Some extra file-list safety checks.
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/io.c b/io.c
index cf94cee7..a6e3ed30 100644
--- a/io.c
+++ b/io.c
@@ -419,6 +419,7 @@ static void forward_filesfrom_data(void)
while (s != eob) {
if (*s++ == '\0') {
ff_xb.len = s - sob - 1;
+ add_implied_include(sob);
if (iconvbufs(ic_send, &ff_xb, &iobuf.out, flags) < 0)
exit_cleanup(RERR_PROTOCOL); /* impossible? */
write_buf(iobuf.out_fd, s-1, 1); /* Send the '\0'. */
@@ -450,9 +451,12 @@ static void forward_filesfrom_data(void)
char *f = ff_xb.buf + ff_xb.pos;
char *t = ff_xb.buf;
char *eob = f + len;
+ char *cur = t;
/* Eliminate any multi-'\0' runs. */
while (f != eob) {
if (!(*t++ = *f++)) {
+ add_implied_include(cur);
+ cur = t;
while (f != eob && *f == '\0')
f++;
}