Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>, gorcunov@gmail.com
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 2/2] box: fix uninitialized access to version_id in process_subscribe()
Date: Tue, 31 Aug 2021 12:17:40 +0300	[thread overview]
Message-ID: <822222ec-57f0-71eb-9473-360fefe9e385@tarantool.org> (raw)
In-Reply-To: <385ccffc-abee-b0be-4805-addbff4efcd7@tarantool.org>



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


  reply	other threads:[~2021-08-31  9:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 10:33 [Tarantool-patches] [PATCH 0/2] replication: fix uninitialized replica_version_id access Serge Petrenko via Tarantool-patches
2021-08-30 10:33 ` [Tarantool-patches] [PATCH 1/2] box: remove unused variable in process_register() Serge Petrenko via Tarantool-patches
2021-08-30 10:33 ` [Tarantool-patches] [PATCH 2/2] box: fix uninitialized access to version_id in process_subscribe() Serge Petrenko via Tarantool-patches
2021-08-30 21:38   ` Vladislav Shpilevoy via Tarantool-patches
2021-08-31  9:17     ` Serge Petrenko via Tarantool-patches [this message]
2021-09-01 21:35       ` Vladislav Shpilevoy via Tarantool-patches
2021-08-30 14:55 ` [Tarantool-patches] [PATCH 0/2] replication: fix uninitialized replica_version_id access Cyrill Gorcunov via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=822222ec-57f0-71eb-9473-360fefe9e385@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 2/2] box: fix uninitialized access to version_id in process_subscribe()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox