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 A2EC76F3FD; Tue, 31 Aug 2021 12:17:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A2EC76F3FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1630401466; bh=MN8laB2H/allYwcLyQmJBjLGGaJRGbxew850XiEh3TU=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=WXCOsmXkoUxBl8n1pSpZIgM7j8a9rqNLSyK3AwuQEjWOffcg6bLOoyIldny192lTV NbfR/EPXsPS/eZClxI5+ZKAvUHgDnarT52QOIrXSKR1VZ1mk0dT+21O1OXjQh6SWaH G1xj8Rr2IAbaz7pbAtUNqdSSE86/ilfSuhwBkO7I= Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [94.100.177.105]) (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 65C606F3FD for ; Tue, 31 Aug 2021 12:17:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 65C606F3FD Received: by smtp45.i.mail.ru with esmtpa (envelope-from ) id 1mKzto-0001DT-Gw; Tue, 31 Aug 2021 12:17:45 +0300 To: Vladislav Shpilevoy , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <8f2f052fe5c362de28a8e6b472c7608902be60a2.1630319507.git.sergepetrenko@tarantool.org> <385ccffc-abee-b0be-4805-addbff4efcd7@tarantool.org> Message-ID: <822222ec-57f0-71eb-9473-360fefe9e385@tarantool.org> Date: Tue, 31 Aug 2021 12:17:40 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <385ccffc-abee-b0be-4805-addbff4efcd7@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9ECFD080E047A606F6525B29142351271182A05F5380850409B87051041A839A51973C55AF529EF2D0ED8D658BC1650BC01B981AFCC906FF3 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7B2CE06D3E4B8AFEBEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B84F9009663064BD8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8B15F7344345EE50BC14A317CAED557EA117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC292D688DDAD4E7BC389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC864E7220B7C550592F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BB835E6E385EA5AF075ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A51BD0909177160041629D791CC03D274402F4641F20A94098D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA752546FE575EB473F1410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3468964757141B82E070F6EA7AD8112B7956FEA26D613B7AB3437217B326E66652810BA6794AA9B6181D7E09C32AA3244CD338070362E17722FDBF796E30B74E7EE8FBBEFAE1C4874CFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojKvNUqyKacB0bdmjeb1hbyg== X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A4464519B18F8E6BC97283F688366DF38D321BC1145C96DC3783424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 2/2] box: fix uninitialized access to version_id in process_subscribe() 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 Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 31.08.2021 00:38, Vladislav Shpilevoy пишет: > Hi! Thanks for the patch! > >> diff --git a/src/box/box.cc b/src/box/box.cc >> index 2c8113cbb..f98437d05 100644 >> --- a/src/box/box.cc >> +++ b/src/box/box.cc >> @@ -2850,8 +2850,8 @@ box_process_subscribe(struct ev_io *io, struct xrow_header *header) >> struct tt_uuid replica_uuid = uuid_nil; >> struct tt_uuid peer_replicaset_uuid = uuid_nil; >> struct vclock replica_clock; >> - uint32_t replica_version_id; >> vclock_create(&replica_clock); >> + uint32_t replica_version_id = 0; > There seems to be an inconsistency in xrow_decode_subscribe(). It takes > multiple optional parameters, but only some of them are reset to default > values before the body is decoded. > > - replicaset_uuid, instance_uuid, vclock, version_id are left untouched > if not found. > > - anon, id_filter are nullified in the beginning. > > Is there a reason why all the parameters can't be set to defaults / reset > right in xrow_decode_subscribe() before the body is decoded? I think not. Would you prefer nullifying all the parameters in xrow_decode_subscribe() body? -- Serge Petrenko