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 321516EC5A; Thu, 2 Sep 2021 16:22:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 321516EC5A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1630588959; bh=zpkdzYdGJtNomjKkEgalRnV/jtA4Gv8QuEgUDZJkb+I=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=R7/5RJCh8+EcGME+RPdu6zaDMihZnS3+EjCnZMNsZTJ1jiU6lXCwTgB5SU8BzDbbB yPNh43/sH6Ehk6XJuGzut3RKkYA9/zO8Bvf4gmB5reykp0fthHHOwWkepJdE6G+lmo dcE0dx6g7HcYvsp1/O3kn8ok6llYjKlLLP2invzI= 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 5AE256F3F9 for ; Thu, 2 Sep 2021 16:21:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5AE256F3F9 Received: by smtp61.i.mail.ru with esmtpa (envelope-from ) id 1mLmew-0000Ed-Lm; Thu, 02 Sep 2021 16:21:39 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Date: Thu, 2 Sep 2021 16:21:34 +0300 Message-Id: <7b374c0b4f05562ef0e1e65ea3270f3e9aa57f68.1630588778.git.sergepetrenko@tarantool.org> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9D96C1EA41D18F4D58D04F3E644628B13AEFE843B3F5982AA182A05F538085040378A95013E2FDDA5B309B9D93BAD97DEF54E3FE4B13BA7E1DFAEBB6AE405A2FD X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE716FAD50E497B9C14EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D7F1BE85E7B0CA818638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84A85BB91934222DC9BB4E23AD4FC7282117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC60CDF180582EB8FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FC26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EEC24E1E72F37C03A0043FB282AF95FB6BD8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE364E7220B7C550592040F9FF01DFDA4A8C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637BF1C901A33650803EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458F0AFF96BAACF4158235E5A14AD4A4A4625E192CAD1D9E79DB8BF922E402C092C0310A6C46CDA40F8 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C416511BB2D3FAED20AD7560DA06F976FEC6737E719548B2D9C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EFCCE3E035A672CDEE699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D343F22CE0A71FDB37EA0260D18D5A92C71B118BE83F59BF9620BBBB96A6DB19357C289DD498B3DBCAC1D7E09C32AA3244CF7FFB5493E169F58694A9CACF99B38A83E8609A02908F271927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojK/h3ZnmlPjGdZm6P7b2Buw== X-Mailru-Sender: 583F1D7ACE8F49BD31DE23046B3A8460CE3168193A4841758428DCEBE1AF5CDD334CAB6DA6D095946BB2E709EA627F343C7DDD459B58856F0E45BC603594F5A135B915D4279FF0579437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 2/2] xrow: reset parameters of decode_subscribe() to default 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: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Nullify all the output parameters passed to xrow_decode_subscribe(). This should help us get rid of cases when some of the parameters were left uninitialized when the SUBSCRIBE request didn't contain the corresponding fields. Follow-up #6034 --- src/box/xrow.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/box/xrow.c b/src/box/xrow.c index 7df1af4ab..3cad2c1be 100644 --- a/src/box/xrow.c +++ b/src/box/xrow.c @@ -1561,10 +1561,19 @@ xrow_decode_subscribe(struct xrow_header *row, struct tt_uuid *replicaset_uuid, return -1; } - if (anon) + if (replicaset_uuid != NULL) + *replicaset_uuid = uuid_nil; + if (instance_uuid != NULL) + *instance_uuid = uuid_nil; + if (vclock != NULL) + vclock_create(vclock); + if (version_id != NULL) + *version_id = 0; + if (anon != NULL) *anon = false; - if (id_filter) + if (id_filter != NULL) *id_filter = 0; + d = data; uint32_t map_size = mp_decode_map(&d); for (uint32_t i = 0; i < map_size; i++) { -- 2.30.1 (Apple Git-130)