diff options
author | Wayne Davison <wayne@opencoder.net> | 2022-07-31 16:55:34 -0700 |
---|---|---|
committer | Wayne Davison <wayne@opencoder.net> | 2022-07-31 17:46:34 -0700 |
commit | b7231c7d02cfb65d291af74ff66e7d8c507ee871 (patch) | |
tree | d09cf63819fca7c3932c7d605c103048af9fb734 /io.c | |
parent | 15c34f0a8c76e250f5487997849ab31e40e556e9 (diff) | |
download | rsync-b7231c7d02cfb65d291af74ff66e7d8c507ee871.tar.gz |
Some extra file-list safety checks.
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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++; } |