Skip to content

Commit 533449a

Browse files
committed
auto clamp the request range
1 parent 64116ee commit 533449a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/replicator.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ class Peer {
10871087
return false
10881088
}
10891089

1090-
const end = Math.min(r.end === -1 ? this.remoteLength : r.end, this.remoteLength)
1090+
const end = Math.min(this.core.tree.length, Math.min(r.end === -1 ? this.remoteLength : r.end, this.remoteLength))
10911091
if (end <= r.start || fork !== this.remoteFork) return false
10921092

10931093
const len = end - r.start

0 commit comments

Comments
 (0)