You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2021/05/14 16:08:07 UTC
[commons-compress] 02/02: fix single-byte read when nothing has
been read
This is an automated email from the ASF dual-hosted git repository.
bodewig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
commit 2d1392d2544165df2ae6bdb73f7473fd30dad33f
Author: Stefan Bodewig <st...@innoq.com>
AuthorDate: Fri May 14 18:05:39 2021 +0200
fix single-byte read when nothing has been read
Credit to OSS-Fuzz
---
.../org/apache/commons/compress/utils/BoundedArchiveInputStream.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/compress/utils/BoundedArchiveInputStream.java b/src/main/java/org/apache/commons/compress/utils/BoundedArchiveInputStream.java
index b8e351c..d685968 100644
--- a/src/main/java/org/apache/commons/compress/utils/BoundedArchiveInputStream.java
+++ b/src/main/java/org/apache/commons/compress/utils/BoundedArchiveInputStream.java
@@ -58,7 +58,7 @@ public abstract class BoundedArchiveInputStream extends InputStream {
singleByteBuffer.rewind();
}
int read = read(loc, singleByteBuffer);
- if (read < 0) {
+ if (read < 1) {
return read;
}
loc++;