This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch support/nifi-1.x
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/support/nifi-1.x by this push:
     new 24906dd20b NIFI-11971: Ensure that when creating a new content claim 
that we always treat an existing claim length of -1 as 0, to ensure that we 
never add -1 to our offset
24906dd20b is described below

commit 24906dd20bd1f533a23268a4a85242dff68db75e
Author: Mark Payne <[email protected]>
AuthorDate: Mon Aug 21 10:17:53 2023 -0400

    NIFI-11971: Ensure that when creating a new content claim that we always 
treat an existing claim length of -1 as 0, to ensure that we never add -1 to 
our offset
    
    This closes #7631
    
    Signed-off-by: David Handermann <[email protected]>
    (cherry picked from commit baea7ffee943009f5bf178dedf7f6e0de5bfc9ae)
---
 .../org/apache/nifi/controller/repository/FileSystemRepository.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
index 0e94cdab6d..e02bfcd6bd 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
@@ -1970,7 +1970,7 @@ public class FileSystemRepository implements 
ContentRepository {
 
         @Override
         public synchronized ContentClaim newContentClaim() throws IOException {
-            scc = new StandardContentClaim(scc.getResourceClaim(), 
scc.getOffset() + scc.getLength());
+            scc = new StandardContentClaim(scc.getResourceClaim(), 
scc.getOffset() + Math.max(0, scc.getLength()));
             initialLength = 0;
             bytesWritten = 0L;
             incrementClaimaintCount(scc);

Reply via email to