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 6F6716F3D0; Tue, 31 Aug 2021 00:39:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6F6716F3D0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1630359542; bh=FYQVH0BxRAd9HCNHcWxCtqSH+dB5+bbqKQHEkLi54lA=; 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=jH7mhxnVIHxo4b3rpCiGThqiOPRjD3UmK12HjZ/ATGLKPm/9ln6GfLlvXys1rEqyW IMv1BX5iKPo+Io5a+OGqBaTwSVWzTdSXopDthQoSLLYYJ+6uO9emwgHnvXEld6ggRE iNFvqqoP3OfH+P2ba4wkEfDCNrTIAIPERmJ19GcA= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (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 DA0506F3D0 for ; Tue, 31 Aug 2021 00:39:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DA0506F3D0 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1mKozc-0003kT-5e; Tue, 31 Aug 2021 00:39:00 +0300 To: Serge Petrenko , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <8f2f052fe5c362de28a8e6b472c7608902be60a2.1630319507.git.sergepetrenko@tarantool.org> Message-ID: <385ccffc-abee-b0be-4805-addbff4efcd7@tarantool.org> Date: Mon, 30 Aug 2021 23:38:59 +0200 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: <8f2f052fe5c362de28a8e6b472c7608902be60a2.1630319507.git.sergepetrenko@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9D5AC6413C25DCF08CC98B8FCC5CD86F3182A05F5380850403C447A5293100BFF110C6F6672D6B39921266CF73A281FF08437CBA027D6BDB1 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AE8B5BEC11030C2FEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F7C2A16C2A438FE58638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D892487353CC1A316A3C38500580ADBCB0117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAE9A1BBD95851C5BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520140C956E756FBB7AC26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B65D56369A3576CBA5089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B505952DBA56822D4FCF92E99B13A80AAA81 X-C1DE0DAB: 0D63561A33F958A57C444B4D14C6D968BA46637CC5A63686FEB4A1D486881551D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA752546FE575EB473F1410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A533D6DF7731C664DD373C555700063F86E5E4B9E5BAEBD8DA91D7BDF46EBF0D207C50D16CD53E061D7E09C32AA3244C965496FDAB34240FF72B885BFF9D3F4CA995755A1445935EFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj4DnN7V8kJ6ulbg0ySBSjMA== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D00F621F4425C1A7483A403E66412FD7D3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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?