Skip to content

Commit

Permalink
Ensure jvmBaseFileOffset is not -1 after not finding matching quad pa…
Browse files Browse the repository at this point in the history
…tterns while in-use
  • Loading branch information
Col-E committed Aug 14, 2024
1 parent b8660a9 commit 548a501
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>software.coley</groupId>
<artifactId>lljzip</artifactId>
<version>2.6.1</version>
<version>2.6.2</version>

<name>LL Java ZIP</name>
<description>Lower level ZIP support for Java</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ else if (MemorySegmentUtil.readQuad(data, jvmBaseFileOffset) == ZipPatterns.CENT
}
}

// Normalize for when the 'indexOfWord' checks above yield no results.
jvmBaseFileOffset = Math.max(0, jvmBaseFileOffset);

// Read local files
// - Set to prevent duplicate file header entries for the same offset
Set<Long> offsets = new HashSet<>();
Expand Down

0 comments on commit 548a501

Please sign in to comment.