Commit 557a35f5 authored by Wayne Davison's avatar Wayne Davison

If adding a trailing dot to a directory name overflows

MAXPATHLEN, die with an overflow error.
parent 1848fd6f
......@@ -1120,7 +1120,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
if (l == 2 && fname[0] == '.') {
/* Turn "./" into just "." rather than "./." */
fname[1] = '\0';
} else if (l < MAXPATHLEN) {
} else {
if (l + 1 >= MAXPATHLEN)
overflow("send_file_list");
fname[l++] = '.';
fname[l] = '\0';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment