commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [commons-compress] theobisproject commented on a change in pull request #76: COMPRESS-481 Allow passing memory limit to SevenZFile
Date Tue, 16 Apr 2019 11:57:52 GMT
theobisproject commented on a change in pull request #76: COMPRESS-481 Allow passing memory
limit to SevenZFile
URL: https://github.com/apache/commons-compress/pull/76#discussion_r275759994
 
 

 ##########
 File path: src/main/java/org/apache/commons/compress/archivers/sevenz/LZMADecoder.java
 ##########
 @@ -34,11 +35,13 @@
 
     @Override
     InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength,
-            final Coder coder, final byte[] password) throws IOException {
+            final Coder coder, final byte[] password, int maxMemoryLimitInKb) throws IOException
{
         final byte propsByte = coder.properties[0];
         final int dictSize = getDictionarySize(coder);
         if (dictSize > LZMAInputStream.DICT_SIZE_MAX) {
             throw new IOException("Dictionary larger than 4GiB maximum size used in " + archiveName);
+        } else if ((dictSize / 1024) > maxMemoryLimitInKb) {
 
 Review comment:
   Didn't know about that. I changed the code according to your comment. Do

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message