X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/54504b8e4f0c23ca1044970c99f4902dbbc7b9f3..3b22184d4c61e6dc77ec15f93bb760046c40533e:/generator.c diff --git a/generator.c b/generator.c index 078b9d4d..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) @@ -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);