From 742650719518b26b6d9bf7e4d43d8599ae5ff498 Mon Sep 17 00:00:00 2001 From: arvindvis Date: Wed, 29 Mar 2017 20:14:23 -0700 Subject: [PATCH] In for loop, separating the variables in if condition is not the way to compare the conditions (If comma separated only the last specified condition gets executed). This is not desirable, because terator it can point to results from MessageTableIndex queries and jt can point to resultss from ObjectTable and their dimensionality is not same and this can result in crash. Closes-Bug:#1675598 Change-Id: I8af6ef7166900ea4705715fd317d2655d2c3b984 --- src/query_engine/set_operation.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/query_engine/set_operation.cc b/src/query_engine/set_operation.cc index 63aaeb160fc..1af1cb6d77e 100644 --- a/src/query_engine/set_operation.cc +++ b/src/query_engine/set_operation.cc @@ -15,7 +15,7 @@ bool query_result_unit_t::operator<(const query_result_unit_t& rhs) const { GenDb::DbDataValueVec::const_iterator it = info.begin(); GenDb::DbDataValueVec::const_iterator jt = rhs.info.begin(); - for (; it != info.end(), jt != rhs.info.end(); it++, jt++) { + for (; it != info.end() && jt != rhs.info.end(); it++, jt++) { if (*it < *jt) { return true; } else if (*jt < *it) {