[Tarantool-patches] [PATCH 1/2] tuple: fix multikey field JSON access crash

Aleksandr Lyapunov alyapunov at tarantool.org
Wed Aug 12 16:05:13 MSK 2020


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,


More information about the Tarantool-patches mailing list