X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/e60c8b59fed2ef52bc6ea635e5f74979bc5b0570..c9bf436e5b80ad7d001773e3d750149c11f39411:/generator.c diff --git a/generator.c b/generator.c index c0bffb2e..b12087fc 100644 --- a/generator.c +++ b/generator.c @@ -567,6 +567,12 @@ static void sum_sizes_sqroot(struct sum_struct *sum, int64 len) int s2length; int64 l; + if (len < 0) { + /* The file length overflowed our int64 var, so we can't process this file. */ + sum->count = -1; /* indicate overflow error */ + return; + } + if (block_size) blength = block_size; else if (len <= BLOCK_SIZE * BLOCK_SIZE) @@ -1032,7 +1038,7 @@ static void list_file_entry(struct file_struct *f) #ifdef SUPPORT_LINKS if (preserve_links && S_ISLNK(f->mode)) { rprintf(FINFO, "%s %*s %s %s -> %s\n", - permbuf, colwidth, comma_num(len), + permbuf, colwidth, human_num(len), timestring(f->modtime), f_name(f, NULL), F_SYMLINK(f)); } else @@ -1043,7 +1049,7 @@ static void list_file_entry(struct file_struct *f) f_name(f, NULL)); } else { rprintf(FINFO, "%s %*s %s %s\n", - permbuf, colwidth, comma_num(len), + permbuf, colwidth, human_num(len), timestring(f->modtime), f_name(f, NULL)); } } @@ -1354,10 +1360,11 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, const char *sl = F_SYMLINK(file); if (safe_symlinks && unsafe_symlink(sl, fname)) { if (INFO_GTE(NAME, 1)) { - if (solo_file) + if (solo_file) { /* fname contains the destination path, but we * want to report the source path. */ fname = f_name(file, NULL); + } rprintf(FINFO, "ignoring unsafe symlink \"%s\" -> \"%s\"\n", fname, sl);