[Tarantool-patches] [PATCH 1/1] app: handle concatenated argv name-value correctly
Kirill Yukhin
kyukhin at tarantool.org
Thu Feb 20 09:24:42 MSK 2020
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
More information about the Tarantool-patches
mailing list