[Tarantool-patches] [PATCH v4 3/4] replication: implement an instance id filter for relay

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Feb 28 02:33:33 MSK 2020


>>> +return -1;
>>> +}
>>> +uint32_t len = mp_decode_array(&d);
>>> +for(uint32_t i = 0; i < len; ++i) {
>>> +if (mp_typeof(*d) != MP_UINT)
>>> +goto decode_err;
>>> +*id_filter |= 1 << mp_decode_uint(&d);
>>
>> 7. If someone would send a big ID (a program, pretending to be a Tarantool
>> instance), it would cause unsigned bit shift overflow, which is undefined
>> behaviour. Lets check that it is not bigger than 31.
>>
>> However this won't really help much. This code will crash even if I will
>> just send a truncated packet. From what I see.
> 
> I’m not sure I understand what you’re speaking about. This piece of code is
> similar to the one we have in mp_decode_vclock. The situation didn’t get worse,
> at least.

Never mind, I see iproto_msg_decode() checks MessagePack is correct.


More information about the Tarantool-patches mailing list