Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-12677

DecompressorStream throws IndexOutOfBoundsException when calling skip(long)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 2.4.0, 2.6.0, 3.0.0-alpha1
    • None
    • io

    Description

      DecompressorStream.skip(long) throws an IndexOutOfBoundException when using a long bigger than Integer.MAX_VALUE

      This is because of this cast from long to int: https://github.com/apache/hadoop-common/blob/HADOOP-3628/src/core/org/apache/hadoop/io/compress/DecompressorStream.java#L125

      The fix is probably to do the cast after applying Math.min: in that case, it should not be an issue since it should not be bigger than the buffer size (512)

      Attachments

        1. HADOOP-12677.001.patch
          3 kB
          Wei-Chiu Chuang
        2. HADOOP-12677.002.patch
          3 kB
          Wei-Chiu Chuang

        Issue Links

          Activity

            People

              weichiu Wei-Chiu Chuang
              laurent Laurent Goujon
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: