From 557a35f55bf4cb99f5cce1d966598e11c03318cc Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 13 May 2005 22:02:24 +0000 Subject: [PATCH] If adding a trailing dot to a directory name overflows MAXPATHLEN, die with an overflow error. --- flist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flist.c b/flist.c index 29d75cab..b3c966ed 100644 --- a/flist.c +++ b/flist.c @@ -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'; } -- 2.34.1