Commit 929002a2 authored by Wayne Davison's avatar Wayne Davison

Avoid infinite loop if the file's length is negative.

Fixes bug 4664.
parent a64840a2
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment