From a235cff0c50dffac2e8be0e89d37af64081b4bba Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Wed, 28 May 2025 10:59:17 +0200 Subject: [PATCH] Chunker: fix infinite loop Could happen at EOF when remaining data is insufficient and no new data can be added. --- src/borg/chunker.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/borg/chunker.pyx b/src/borg/chunker.pyx index 6a13f4e86..b5dca07de 100644 --- a/src/borg/chunker.pyx +++ b/src/borg/chunker.pyx @@ -680,7 +680,7 @@ cdef class Chunker: self.remaining -= min_size sum = _buzhash(self.data + self.position, window_size, self.table) - while self.remaining > self.window_size and (sum & chunk_mask): + while self.remaining > self.window_size and (sum & chunk_mask) and not (self.eof and self.remaining <= window_size): p = self.data + self.position stop_at = p + self.remaining - window_size