Skip to content

Instantly share code, notes, and snippets.

@danieldk
Created October 31, 2012 12:15
Show Gist options
  • Select an option

  • Save danieldk/3986724 to your computer and use it in GitHub Desktop.

Select an option

Save danieldk/3986724 to your computer and use it in GitHub Desktop.
Fix segfault in UnionQP in DB XML 2.5.16.
--- dbxml-2.5.16.orig/dbxml/src/dbxml/query/UnionQP.cpp
+++ dbxml-2.5.16/dbxml/src/dbxml/query/UnionQP.cpp
@@ -485,13 +485,13 @@ bool UnionIterator::next(DynamicContext
bool UnionIterator::seek(int container, const DocID &did, const NsNid &nid, DynamicContext *context)
{
- if((next_ & LEFT) || (left_ && isSameNID(left_, container, did, nid) < 0)) {
+ if((next_ & LEFT && left_) || (left_ && isSameNID(left_, container, did, nid) < 0)) {
if(!left_->seek(container, did, nid, context)) {
delete left_;
left_ = 0;
}
}
- if((next_ & RIGHT) || (right_ && isSameNID(right_, container, did, nid) < 0)) {
+ if((next_ & RIGHT && right_) || (right_ && isSameNID(right_, container, did, nid) < 0)) {
if(!right_->seek(container, did, nid, context)) {
delete right_;
right_ = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment