From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [94.100.177.112]) (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 8F398469719 for ; Thu, 20 Feb 2020 09:24:44 +0300 (MSK) Date: Thu, 20 Feb 2020 09:24:42 +0300 From: Kirill Yukhin Message-ID: <20200220062442.chl7cnrpusxfwond@tarantool.org> References: <450bafe2e276ac6e520d4772f82f033873c8039a.1582067172.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <450bafe2e276ac6e520d4772f82f033873c8039a.1582067172.git.v.shpilevoy@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 1/1] app: handle concatenated argv name-value correctly List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org Hello, On 19 фев 00:08, Vladislav Shpilevoy wrote: > The server used to crash when any option argument was passed with > a value concatenated to it, like this: '-lvalue', '-evalue' > instead of '-l value' and '-e value'. > > However this is a valid way of writing values, and it should not > have crashed regardless of its validity. > > The bug was in usage of 'optind' global variable from getopt() > function family. It is not supposed to be used for getting an > option's value. It points to a next argv to parse. Next argv != > value of current argv, like it was with '-lvalue' and '-evalue'. > > For getting a current value there is a variable 'optarg'. > > Closes #4775 > --- > Branch: https://github.com/tarantool/tarantool/tree/gerold103/gh-4775-crash-on-l-e-opts > Issue: https://github.com/tarantool/tarantool/issues/4775 I've checked your patch into 1.10, 2.2, 2.3 and master. -- Regards, Kirill Yukhin