From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 1E35028485 for ; Fri, 22 Feb 2019 10:07:56 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y_sgk1LkkeGK for ; Fri, 22 Feb 2019 10:07:56 -0500 (EST) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 5F95A28484 for ; Fri, 22 Feb 2019 10:07:55 -0500 (EST) Subject: [tarantool-patches] Re: [PATCH v2] sql: display decoded msgpack for EXPLAIN queries References: <20190215173727.88956-1-korablev@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Fri, 22 Feb 2019 18:07:51 +0300 MIME-Version: 1.0 In-Reply-To: <20190215173727.88956-1-korablev@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: Nikita Pettik , tarantool-patches@freelists.org, Kirill Yukhin On 15/02/2019 20:37, Nikita Pettik wrote: > During DDL routines we pass encoded space/index/trigger formats > into msgpack to VDBE. EXPLAIN query displays arguments of each opcode of > VDBE program in a readable format. So, lets decode arguments of OP_Blob > opcode with subtype = _MSGPACK before displaying them. Also, lets > enlarge static buffers for P4 operand value and opcode comment to fit > decoded msgpack. > > What is more, it fixes buffer-overflow since before this patch operands > of OP_Blob were treated as strings and passed to functions like strlen() > (only during EXPLAIN query). On the other hand, generally speaking > msgpack can come without null termination, or contain '\0' symbols in > the middle of encoded array. > > Closes #3868 > --- > Branch: https://github.com/tarantool/tarantool/tree/np/gh-3868-buffer-overflow-v2 > Issue: https://github.com/tarantool/tarantool/issues/3868 > LGTM.