PeterAlfreadLee commented on a change in pull request #91: Make bz2 
decompressor robust to selector overflow
URL: https://github.com/apache/commons-compress/pull/91#discussion_r368829387
 
 

 ##########
 File path: 
src/test/java/org/apache/commons/compress/compressors/bzip2/BZip2NSelectorsOverflowTest.java
 ##########
 @@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.compressors.bzip2;
+
+import org.apache.commons.compress.AbstractTestCase;
+import org.apache.commons.compress.compressors.CompressorInputStream;
+import org.apache.commons.compress.compressors.CompressorStreamFactory;
+import org.apache.commons.compress.utils.IOUtils;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+
+public class BZip2NSelectorsOverflowTest extends AbstractTestCase {
+
+    /**
+     * See https://sourceware.org/ml/bzip2-devel/2019-q3/msg00007.html
+     */
+    @Test()
+    public void shouldDecompressBlockWithNSelectorOverflow() throws Exception {
+        File decompressed = 
getFile("rec02841dewiki-20191201-pages-meta-history5.xml-p8161946p8319641.bz2");
+        final File toDecompress = 
getFile("rec02841dewiki-20191201-pages-meta-history5.xml-p8161946p8319641.bz2");
 
 Review comment:
   Why the decompressed file and toDecompress file are the same file?
   Maybe we should compare the decompressed file with 
src/test/resources/rec02841dewiki-20191201-pages-meta-history5.xml-p8161946p8319641?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to