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
Attachments
Issue Links
- links to