Added a paranoid length check.

This commit is contained in:
Wayne Davison
2006-10-13 23:17:30 +00:00
parent 55410368e5
commit deee574b11

View File

@@ -1228,8 +1228,11 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
}
}
if (fn != fbuf)
if (fn != fbuf) {
if (len >= MAXPATHLEN)
overflow_exit("send_file_list");
memmove(fbuf, fn, len + 1);
}
if (implied_dirs && (p=strrchr(fbuf,'/')) && p != fbuf) {
/* Send the implied directories at the start of the