[Tarantool-patches] [PATCH 2/6] sql: fix possible null dereference in sql_expr_coll()

Nikita Pettik korablev at tarantool.org
Wed Nov 27 15:15:42 MSK 2019


---
 src/box/sql/expr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/box/sql/expr.c b/src/box/sql/expr.c
index 648b7170e..0bdcfe576 100644
--- a/src/box/sql/expr.c
+++ b/src/box/sql/expr.c
@@ -332,7 +332,8 @@ sql_expr_coll(Parse *parse, Expr *p, bool *is_explicit_coll, uint32_t *coll_id,
 				sql_func_by_signature(p->u.zToken, arg_count);
 			if (func == NULL)
 				break;
-			if (sql_func_flag_is_set(func, SQL_FUNC_DERIVEDCOLL)) {
+			if (sql_func_flag_is_set(func, SQL_FUNC_DERIVEDCOLL) &&
+			    arg_count > 0) {
 				/*
 				 * Now we use quite straightforward
 				 * approach assuming that resulting
-- 
2.15.1



More information about the Tarantool-patches mailing list