impala-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tarmstr...@apache.org
Subject [03/11] incubator-impala git commit: IMPALA-5774: Prevent FindInSet() from reading off end of string
Date Tue, 08 Aug 2017 19:02:17 GMT
IMPALA-5774: Prevent FindInSet() from reading off end of string

Change-Id: I541c8e6bb712e380f9610d6bfa35e2d515a31d1d
Reviewed-on: http://gerrit.cloudera.org:8080/7608
Reviewed-by: Sailesh Mukil <sailesh@cloudera.com>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/5caadbbe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/5caadbbe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/5caadbbe

Branch: refs/heads/master
Commit: 5caadbbedd1917019937290e9427fd6f798f0cd8
Parents: b881fba
Author: Henry Robinson <henry@cloudera.com>
Authored: Mon Aug 7 12:35:54 2017 -0700
Committer: Impala Public Jenkins <impala-public-jenkins@gerrit.cloudera.org>
Committed: Mon Aug 7 23:41:45 2017 +0000

----------------------------------------------------------------------
 be/src/exprs/string-functions-ir.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/5caadbbe/be/src/exprs/string-functions-ir.cc
----------------------------------------------------------------------
diff --git a/be/src/exprs/string-functions-ir.cc b/be/src/exprs/string-functions-ir.cc
index 5c66541..d0c8679 100644
--- a/be/src/exprs/string-functions-ir.cc
+++ b/be/src/exprs/string-functions-ir.cc
@@ -814,7 +814,7 @@ IntVal StringFunctions::FindInSet(FunctionContext* context, const StringVal&
str
   do {
     end = start;
     // Position end.
-    while(str_set.ptr[end] != ',' && end < str_set.len) ++end;
+    while (end < str_set.len && str_set.ptr[end] != ',') ++end;
     StringValue token(reinterpret_cast<char*>(str_set.ptr) + start, end - start);
     if (str_sv.Eq(token)) return IntVal(token_index);
 


Mime
View raw message