app: fix crash with multiple -e -l options
Tarantool used to crash if launched with multiple -e or -l options without a space between the option and the value, e.g.: `tarantool -ea -eb`. It happened because optv[] was allocated for argc==3 items, while 4 options were written to it after parsing (-e, a, -e, b). This patch allocates optv[] for the maximum possible number of options: (argc - 1) * 2. Closes #5747 NO_DOC=bugfix
Showing
- changelogs/unreleased/gh-5747-crash-multiple-args.md 4 additions, 0 deletionschangelogs/unreleased/gh-5747-crash-multiple-args.md
- src/main.cc 4 additions, 5 deletionssrc/main.cc
- test/app-luatest/gh_5747_crash_multiple_args_test.lua 8 additions, 0 deletionstest/app-luatest/gh_5747_crash_multiple_args_test.lua
Loading