Uploaded image for project: 'ORC'
  1. ORC
  2. ORC-979 C++ API QA
  3. ORC-1081

heap-use-after-free in orc::SearchArgumentBuilderImpl::end()

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.0, 1.7.1, 1.7.2
    • 1.7.3
    • C++
    • None

    Description

      Built ORC with AddressSanitizer and found a heap-use-after-free error in orc::SearchArgumentBuilderImpl::end()

      SearchArgumentBuilder& SearchArgumentBuilderImpl::end() {
        TreeNode& current = mCurrTree.front();
        mCurrTree.pop_front();  // <----- This will delete the TreeNode.
        if (current->getChildren().empty()) {
          throw std::invalid_argument("Cannot create expression " +
            mRoot->toString() + " with no children.");
        }
        if (current->getOperator() == ExpressionTree::Operator::NOT &&
            current->getChildren().size() != 1) {
          throw std::invalid_argument("Can't create NOT expression " +
            current->toString() + " with more than 1 child.");
        }
        return *this;
      } 

      We should call mCurrTree.pop_front() after using the TreeNode.

      Attachments

        1. asan_report.txt
          10 kB
          Quanlong Huang

        Issue Links

          Activity

            People

              stigahuang Quanlong Huang
              stigahuang Quanlong Huang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: