rsync/rsync-3.0.7-buf-overflow.patch

14 lines
455 B
Diff
Raw Normal View History

--- rsync-3.0.7/flist.c.orig 2010-01-22 22:39:40.000000000 +0100
+++ rsync-3.0.7/flist.c 2010-01-22 22:45:27.618262042 +0100
@@ -3025,6 +3025,10 @@ char *f_name(const struct file_struct *f
if (f->dirname) {
int len = strlen(f->dirname);
+ if (len >= MAXPATHLEN) {
+ rprintf(FWARNING,"Path too long!\n");
+ return NULL;
+ }
memcpy(fbuf, f->dirname, len);
fbuf[len] = '/';
strlcpy(fbuf + len + 1, f->basename, MAXPATHLEN - (len + 1));