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 574896B467; Tue, 23 Mar 2021 12:45:48 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 574896B467 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616492748; bh=KAYAbzh5xzTqaGDNgaaOWCfzRJwM7MNLlhd0t7j4QYs=; 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=bXv4l/Z2/ATxkIuLWqyqKXync9SUOtUDHS4BbOYoZZo2v0gAW7E3iRs9GyeUl2qp8 Q6ubp3Fsdz7z0jUty7tlJ/nA2kaSB37CdcZ6YzXFHqj7hX7gyl9rJYgvuUF+IhZorB I4ZK2Kq/vQmQ3uT8mxzPo1LotUd1zkDV9BKCJrKM= Received: from smtp61.i.mail.ru (smtp61.i.mail.ru [217.69.128.41]) (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 666856B467 for ; Tue, 23 Mar 2021 12:35:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 666856B467 Received: by smtp61.i.mail.ru with esmtpa (envelope-from ) id 1lOdRw-0004jM-Nb; Tue, 23 Mar 2021 12:35:45 +0300 To: v.shpilevoy@tarantool.org, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Tue, 23 Mar 2021 12:35:44 +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: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD95D6E7CC48CB1F5F179C48A9DDACBFB6F5347129BC2C9341C182A05F53808504027E21AFE7CD5AC8276A25E5D20947EA5596B18549EDC0DDBFB5D3E0175467C1D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7CE4525FFB91B9BBCEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B997C8222C70C3D98638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C686AF563A045C75ECA6A5D0CF3C1E0F27CF5AB3C367AFC67A471835C12D1D9774AD6D5ED66289B5259CC434672EE6371117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE71AE4D56B06699BBC9FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE78C612D1A93CAB8ACD32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED629923F8577A6DFFEA7CDFE15683C0CD6E53CD04E86FAF290E2D7E9C4E3C761E06A71DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF5012EF20D2F80756B5F868A13BD56FB6657A7F4EDE966BC389F9E8FC8737B5C22492D71FFFE2C4DB622089D37D7C0E48F6CCF19DD082D7633A0E7DDDDC251EA7DABAAAE862A0553A3920E30A4C9C8E338DA04A91C4D4C4F5ED443847C11F186F3C5E7DDDDC251EA7DABCC89B49CDF41148FDCD13837A2BCF0203C9F3DD0FB1AF5EB4E70A05D1297E1BBCB5012B2E24CD356 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2BBE337FB72E92315FF39D8DB89857825EFA8BF88FCBFD63CE0852D54D1EC5181386D740E071D760D78A0466013A736C9 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C686AF563A045C75ECA6A5D0CF3C1E0F27CF5AB3C367AFC679C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34197948450CB5442AF20DB445DCC47ABEC7A67040A1A305E77C168499EC6A1F8EC84F125F2C6B91191D7E09C32AA3244CB2291008460F84DFDB4531984185E2535A1673A01BA68E40FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojWJZv20R+6UguNt6mPMauKg== X-Mailru-Sender: 5C3750E245F362008BC1685FEC6306ED758EDD94888027C076A25E5D20947EA57CF96F699FB252595105BD0848736F9966FEC6BF5C9C28D97E07721503EA2E00ED97202A5A4E92BF7402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v4 22/53] 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 e58526401..9d07358e6 100644 --- a/src/box/sql/vdbeaux.c +++ b/src/box/sql/vdbeaux.c @@ -2240,6 +2240,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