aboutsummaryrefslogtreecommitdiffstats
path: root/flist.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-10-13 23:17:30 +0000
committerWayne Davison <wayned@samba.org>2006-10-13 23:17:30 +0000
commitdeee574b1198a2886369f4ecbfbeaa6f851bb41d (patch)
treea3a99b7abdbcdbde2b44d296e8a102b61043f488 /flist.c
parent55410368e51074c167154689de0236c05df1ce6c (diff)
downloadandroid_external_rsync-deee574b1198a2886369f4ecbfbeaa6f851bb41d.tar.gz
android_external_rsync-deee574b1198a2886369f4ecbfbeaa6f851bb41d.tar.bz2
android_external_rsync-deee574b1198a2886369f4ecbfbeaa6f851bb41d.zip
Added a paranoid length check.
Diffstat (limited to 'flist.c')
-rw-r--r--flist.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/flist.c b/flist.c
index 7e4eef55..e8043c57 100644
--- a/flist.c
+++ b/flist.c
@@ -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