diff --git a/src/shared/copy.c b/src/shared/copy.c index 836753cc75..5221397da5 100644 --- a/src/shared/copy.c +++ b/src/shared/copy.c @@ -346,6 +346,8 @@ int copy_bytes_full( /* Make sure we're not copying more than the current data segment. */ m = MIN(m, (size_t) e - c); + if (m <= 0) + continue; } /* First try copy_file_range(), unless we already tried */