Uploaded image for project: 'ORC'
  1. ORC
  2. ORC-589

[C++] ORC doesn't check for negative dictionary entry lengths anymore

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.6.3, 1.7.0
    • None
    • None

    Description

      The constructor of StringDictionaryColumnReader used to have a check for negative dictionary entry lengths:

      https://github.com/apache/orc/blob/branch-1.5/c%2B%2B/src/ColumnReader.cc#L523-L524

      for (uint64_t i = 1; i < dictionaryCount + 1; ++i) {
        if (lengthArray[i] < 0) 
          throw ParseError("Negative dictionary entry length");
        lengthArray[i] += lengthArray[i - 1];
      }

      However we don't have it on current master. It causes a problem because it will use a negative value (casted to unsigned) to allocate a DataBuffer:

       

      dictionary->dictionaryBlob.resize(static_cast<uint64_t>(lengthArray[dictSize]))
      

       

      Attachments

        Issue Links

          Activity

            People

              boroknagyz Zoltán Borók-Nagy
              boroknagyz Zoltán Borók-Nagy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m