Skip to content

Commit c30f2a1

Browse files
committed
Fix handling negative max_length of zlib decompressor
1 parent 7e7d7f0 commit c30f2a1

File tree

1 file changed

+1
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/zlib

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/zlib/JavaDecompress.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ private byte[] createByteArray(byte[] bytes, int length, int maxLength, int bufS
243243
return EMPTY_BYTE_ARRAY;
244244
}
245245

246-
int maxLen = maxLength == 0 ? Integer.MAX_VALUE : maxLength;
246+
int maxLen = maxLength <= 0 ? Integer.MAX_VALUE : maxLength;
247247
byte[] result = new byte[Math.min(maxLen, bufSize)];
248248

249249
int bytesWritten = result.length;

0 commit comments

Comments
 (0)