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 24B6A795FF; Mon, 1 Feb 2021 11:15:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 24B6A795FF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1612167351; bh=We/MqClp2IZ4xXBcNrtZFpe4Rrcvr8OX1+fDgzIdSa8=; 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=kZwNBqWo5HuwKBMLaruklRAFx4cGIdQ/6tjoT+XkQtFD0VDZ1n5HjkrzTcmNYVeCH UC5sak9LsQW2O0g3NbRkSfjVoR3OWtrYdlS4JhrzuUj4P7fgTdyE0vhOqgLi8/tIKZ Hb3npZUweFSKe19IUX2DV43KOjitGu1m32ehcmqk= Received: from smtp38.i.mail.ru (smtp38.i.mail.ru [94.100.177.98]) (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 8F12A795FF for ; Mon, 1 Feb 2021 11:14:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8F12A795FF Received: by smtp38.i.mail.ru with esmtpa (envelope-from ) id 1l6UMG-00014D-Qb; Mon, 01 Feb 2021 11:14:53 +0300 To: s.ostanevich@corp.mail.ru, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Mon, 1 Feb 2021 11:14:52 +0300 Message-Id: <6e7e9497d2da3ffa3862f443dec7fb1dd155983e.1612166870.git.imeevma@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD953AC099BC0052A9C4647521586BE7E6324520D2A088600D8182A05F538085040125B141C49941E0FF319271E79A7545AB10920DF48DA59C26451CAC46E028436 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A3DED2DACB82E709C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE73B44982FA5E78411EA1F7E6F0F101C674E70A05D1297E1BBC6CDE5D1141D2B1C2E84A68B945A8DBD7623C5D7F74A351DD5287F9C18BA7F319FA2833FD35BB23D9E625A9149C048EE9ECD01F8117BC8BEA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735209ECD01F8117BC8BEA471835C12D1D977C4224003CC836476EB9C4185024447017B076A6E789B0E975F5C1EE8F4F765FCE71AB3B23E3E399F3AA81AA40904B5D9CF19DD082D7633A078D18283394535A93AA81AA40904B5D98AA50765F790063708802A3B9B521F1DD81D268191BDAD3D698AB9A7B718F8C442539A7722CA490C13377AFFFEAFD26923F8577A6DFFEA7C089C7B220955F2D693EC92FD9297F6715571747095F342E857739F23D657EF2BD5E8D9A59859A8B6A99CF4BA5C1FDA12EFF80C71ABB335746BA297DBC24807EA27F269C8F02392CDC58410348177836EABEDDA51113D120200306258E7E6ABB4E4A6367B16DE6309 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C6FA9FB90A9CF70188231487DBCC4EFFD0521D33FB721DBD29C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF31C0090ACECF247D699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F7CC4EA888783AE04E40B92C085CD1D5B2F9AD8C624BC71D5B4CD010867D3850559EC81BFA3158531D7E09C32AA3244CA3C48692F98F075A4EBB78ACAC2B0E5C5A1673A01BA68E40FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojyKiJYJ15DtIWy7Lc+iDLGw== X-Mailru-Sender: 5C3750E245F362008BC1685FEC6306ED2B3D7EED1E31543CF319271E79A7545A7CF96F699FB252595105BD0848736F9966FEC6BF5C9C28D97E07721503EA2E00ED97202A5A4E92BF7402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v1 02/10] 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 #4470 --- 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 91b64316e..7b8a1e1d8 100644 --- a/src/box/sql/vdbeaux.c +++ b/src/box/sql/vdbeaux.c @@ -2329,6 +2329,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_init(&p->aMem[i]); p->key_def = key_def; p->nField = key_def->part_count + 1; return p; -- 2.25.1