From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp14.mail.ru (smtp14.mail.ru [94.100.181.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 1EC81469719 for ; Sat, 15 Feb 2020 20:37:57 +0300 (MSK) References: <20200215093156.32021-1-olegrok@tarantool.org> <55bad826-7af6-cf0b-b917-743c07d94d62@tarantool.org> From: Oleg Babin Message-ID: Date: Sat, 15 Feb 2020 20:37:55 +0300 MIME-Version: 1.0 In-Reply-To: <55bad826-7af6-cf0b-b917-743c07d94d62@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH] lua: handle uri.format empty input properly List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org, alexander.turenko@tarantool.org Cc: Oleg Babin Hi! Thanks for your review! On 15/02/2020 19:15, Vladislav Shpilevoy wrote: >> However situation then uri.format output is zero-length > > then -> when. > Fixed. Thanks. I've updated commit message. > Lets add a dot to the end of the sentence, and elaborate > a little about why do we call static_alloc() before this > test and fill it with something. You and me are in the context, > but for someone, who doesn't know the issue and looks at this > test it may look strange. Yes. I've added following comment: -- As static allocator is also used in several places -- we should properly handle situation when output -- is zero-length string. -- Here we allocate the whole buffer, -- fill it with some "junk" bytes and -- check that result doesn't contain any of them. I've force-pushed updates to my branch: https://github.com/tarantool/tarantool/tree/olegrok/4779-uri-format-junk-output