You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/08/03 21:22:59 UTC

(commons-compress) 05/16: Fix SpotBugs DLS_DEAD_LOCAL_STORE in SevenZFile.readPackInfo(ByteBuffer, Archive)

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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git

commit e8070cc09727eb68c669282b002ad7b79915a8eb
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Aug 3 14:19:12 2024 -0400

    Fix SpotBugs DLS_DEAD_LOCAL_STORE in SevenZFile.readPackInfo(ByteBuffer,
    Archive)
---
 src/changes/changes.xml                                               | 1 +
 .../java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 9c9535903..fc5d66586 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -53,6 +53,7 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" dev="ggregory" due-to="Gary Gregory">ArchiveOutputStream now extends FilterOutputStream.</action>
       <action type="fix" issue="COMPRESS-685" dev="ggregory" due-to="Archie L. Cobbs, Gary Gregory">Update Javadoc description for GzipCompressorInputStream #551.</action>
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Replace FileNameUtil.getCompressedFileName(String) use of Locale.ENGLISH with Locale.ROOT.</action>
+      <action type="fix" dev="ggregory" due-to="Gary Gregory">Fix SpotBugs DLS_DEAD_LOCAL_STORE in SevenZFile.readPackInfo(ByteBuffer, Archive).</action>
       <!-- ADD -->
       <action type="add" dev="ggregory" due-to="Gary Gregory">Add ArchiveInputStream.forEach(IOConsumer).</action>
       <action type="add" dev="ggregory" due-to="Gary Gregory">Add ArchiveInputStream.iterator().</action>
diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
index 1c8e6f49b..af3b6dde9 100644
--- a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
+++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
@@ -1547,8 +1547,8 @@ public class SevenZFile implements Closeable {
                     archive.packCrcs[i] = 0xffffFFFFL & getInt(header);
                 }
             }
-
-            nid = getUnsignedByte(header);
+            // read one more
+            getUnsignedByte(header);
         }
     }