From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 7B04B4696C0 for ; Wed, 27 Nov 2019 15:15:55 +0300 (MSK) From: Nikita Pettik Date: Wed, 27 Nov 2019 15:15:42 +0300 Message-Id: <1ca68695d7cd7d3d83f4b6829363ef533a23be38.1574846892.git.korablev@tarantool.org> In-Reply-To: References: In-Reply-To: References: Subject: [Tarantool-patches] [PATCH 2/6] sql: fix possible null dereference in sql_expr_coll() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Cc: v.shpilevoy@tarantool.org --- 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