From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id ACBDB6EC5D; Fri, 9 Apr 2021 21:12:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org ACBDB6EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617991935; bh=nI02X304euDwATYD607bMwuSQWM78r3+ia0N+SetiJc=; h=To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=DeVHBi6H14QWXbExH6qP8vS8KPOEd6PE4TJkRmgjgUXfsajoWA+NUXHww995aQ1gk 9OG0cpiliurcQEIlKsnyJoO4mu2QzDoFHWkc1+U1tD7lxk5DRsrpyM8ZrSnOog58Uf RJjGeORyFvcqOYIi+UfedwAd5gYEXxezVQSO/HGg= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 CBB3C6EC5E for ; Fri, 9 Apr 2021 21:11:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CBB3C6EC5E Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lUvba-0004Hs-VF; Fri, 09 Apr 2021 21:11:43 +0300 To: v.shpilevoy@tarantool.org, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Fri, 9 Apr 2021 21:11:42 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E748094FADAEB10E66ADA4C48BE3C291E66DA182A05F538085040619B77E068E8813854204FDEAD4559A5957229D26FEF6622D48B13260C61623A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70312E9A300D47E3BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378D70459436292EC88638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B21ECDE561C4AD3CC03E0F88FFE7389D3721114FFCE5AE9CDCD2E47CDBA5A96583C09775C1D3CA48CFCA5A41EBD8A3A0199FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C37EF884183F8E4D67117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BDC0F6C5B2EEF3D0C75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CD0035DD76F8A8A4F92DE503AD14290B6E50A602514D2B2B19C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F6110710A6CC527F4EF21467912EDBC6FE7F497FD50A043D8EC69080338C8AFA5C34B847302932B51D7E09C32AA3244C78D2121C81630EC9D324ED852B53D6DC35DA7DC5AF9B58C0FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojyO2lHpuZu4QfN30Ro8V7HQ== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822ECDDAE44D46B9AB7B303698E8DD69BC783D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v5 22/52] sql: Initialize MEM in sqlVdbeAllocUnpackedRecord() X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mergen Imeev via Tarantool-patches Reply-To: imeevma@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This patch adds initialization for newly created MEM objects in sqlVdbeAllocUnpackedRecord(). Changing a MEM without being initialized may give us unexpected result. Part of #5818 --- src/box/sql/vdbeaux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/box/sql/vdbeaux.c b/src/box/sql/vdbeaux.c index dff108412..e0d815958 100644 --- a/src/box/sql/vdbeaux.c +++ b/src/box/sql/vdbeaux.c @@ -2264,6 +2264,8 @@ sqlVdbeAllocUnpackedRecord(struct sql *db, struct key_def *key_def) if (!p) return 0; p->aMem = (Mem *) & ((char *)p)[ROUND8(sizeof(UnpackedRecord))]; + for (uint32_t i = 0; i < key_def->part_count + 1; ++i) + mem_create(&p->aMem[i]); p->key_def = key_def; p->nField = key_def->part_count + 1; return p; -- 2.25.1