From: Aleksandr Lyapunov <alyapunov@tarantool.org> To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>, tarantool-patches@dev.tarantool.org, korablev@tarantool.org Subject: Re: [Tarantool-patches] [PATCH 1/2] tuple: fix multikey field JSON access crash Date: Wed, 12 Aug 2020 16:05:13 +0300 [thread overview] Message-ID: <184a98de-9f49-be82-39a5-84b3c7510697@tarantool.org> (raw) In-Reply-To: <8d39159c-31d3-1394-fb04-4793da531772@tarantool.org> Hi! thanks for the fix, as for me it became more understandable. See one minor comment below and LGTM. On 8/12/20 12:24 AM, Vladislav Shpilevoy wrote: > Hi! Thanks for the review! > > + if (offset_slot_hint != NULL) { > *offset_slot_hint = offset_slot; > + /* > + * Hint is never requested for a multikey field without > + * providing a concrete multikey index. > + */ > + assert(!field->is_multikey_part || > + (multikey_idx != MULTIKEY_NONE && > + field->is_multikey_part)); The last '&& field->is_multikey_part' is excess. > + } else if (field->is_multikey_part && > + multikey_idx == MULTIKEY_NONE) { > + /* > + * When the field is multikey, the offset slot points > + * not at the data. It points at 'extra' array of > + * offsets for this multikey index. That array can only > + * be accessed if index in that array is known. It is > + * not known when the field is accessed not in an index. > + * For example, in an application's Lua code by a JSON > + * path. > + */ > + goto parse; > + } > offset_slot_access: > /* Indexed field */ > offset = field_map_get_offset(field_map, offset_slot,
next prev parent reply other threads:[~2020-08-12 13:05 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-08-04 23:45 [Tarantool-patches] [PATCH 0/2] JSON field multikey crash Vladislav Shpilevoy 2020-08-04 23:45 ` [Tarantool-patches] [PATCH 1/2] tuple: fix multikey field JSON access crash Vladislav Shpilevoy 2020-08-06 16:00 ` Oleg Babin 2020-08-06 20:04 ` Vladislav Shpilevoy 2020-08-10 16:09 ` Nikita Pettik 2020-08-11 9:44 ` Aleksandr Lyapunov 2020-08-11 21:24 ` Vladislav Shpilevoy 2020-08-12 13:05 ` Aleksandr Lyapunov [this message] 2020-08-12 20:34 ` Vladislav Shpilevoy 2020-08-04 23:45 ` [Tarantool-patches] [PATCH 2/2] tuple: fix access by JSON path starting from '[*]' Vladislav Shpilevoy 2020-08-10 17:52 ` Nikita Pettik 2020-08-11 18:50 ` Aleksandr Lyapunov 2020-08-10 10:10 ` [Tarantool-patches] [PATCH 0/2] JSON field multikey crash Aleksandr Lyapunov 2020-08-10 22:22 ` Vladislav Shpilevoy 2020-08-12 20:34 ` Vladislav Shpilevoy
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=184a98de-9f49-be82-39a5-84b3c7510697@tarantool.org \ --to=alyapunov@tarantool.org \ --cc=korablev@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 1/2] tuple: fix multikey field JSON access crash' \ /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