}
}
- if (fn != fbuf) {
- if (len >= MAXPATHLEN)
- overflow_exit("send_file_list");
+ if (fn != fbuf)
memmove(fbuf, fn, len + 1);
- }
if (implied_dirs && (p=strrchr(fbuf,'/')) && p != fbuf) {
/* Send the implied directories at the start of the
for (i = 0; i < flist->count; i++) {
file = flist->files[i];
if ((am_root || am_sender) && preserve_uid)
- sprintf(uidbuf, " uid=%ld", (long)file->uid);
+ snprintf(uidbuf, sizeof uidbuf, " uid=%ld", (long)file->uid);
else
*uidbuf = '\0';
if (preserve_gid && file->gid != GID_NONE)
- sprintf(gidbuf, " gid=%ld", (long)file->gid);
+ snprintf(gidbuf, sizeof gidbuf, " gid=%ld", (long)file->gid);
else
*gidbuf = '\0';
if (!am_sender)
- sprintf(depthbuf, "%d", file->dir.depth);
+ snprintf(depthbuf, sizeof depthbuf, "%d", file->dir.depth);
rprintf(FINFO, "[%s] i=%d %s %s%s%s%s mode=0%o len=%.0f%s%s flags=%x\n",
who, i, am_sender ? NS(file->dir.root) : depthbuf,
file->dirname ? file->dirname : "",
int len = strlen(f->dirname);
memcpy(fbuf, f->dirname, len);
fbuf[len] = '/';
- strcpy(fbuf + len + 1, f->basename);
+ strlcpy(fbuf + len + 1, f->basename, MAXPATHLEN - (len + 1));
} else
- strcpy(fbuf, f->basename);
+ strlcpy(fbuf, f->basename, MAXPATHLEN);
return fbuf;
}