Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a64840a
)
Avoid infinite loop if the file's length is negative.
author
Wayne Davison
<wayned@samba.org>
Sat, 21 Aug 2010 18:26:21 +0000
(11:26 -0700)
committer
Wayne Davison
<wayned@samba.org>
Sat, 21 Aug 2010 20:48:01 +0000
(13:48 -0700)
Fixes bug 4664.
generator.c
patch
|
blob
|
blame
|
history
diff --git
a/generator.c
b/generator.c
index
01398b5
..
b12087f
100644
(file)
--- 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;
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)
if (block_size)
blength = block_size;
else if (len <= BLOCK_SIZE * BLOCK_SIZE)