fix out-of-bounds array access when printing help
commit5f7acc64d57613493b222480b4db68cf486b19b4
authorMichael Kruse <isl@meinersbur.de>
Fri, 13 Nov 2020 20:45:42 +0000 (13 20:45 +0000)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Sat, 14 Nov 2020 11:20:01 +0000 (14 12:20 +0100)
treefb5ae6c1d6ac4c7a67ee6e2bd768e936c84d430a
parent8cec80451ea4f2f225629527b99ee2dc54ac2cad
fix out-of-bounds array access when printing help

For each command line option, print_arg_help searches for aliases
following the option entry until a non-alias entry is reached. However,
the help_arg global array consists of a single entry only and the alias
search will try to access past the array.

Add back the terminating isl_arg_end entry that was inadvertently removed
in isl-0.08-35-gc1e5c8982 (introduce isl_args structure that contains
isl_arg list and size of options, Thu Nov 3 10:19:43 2011 +0100)
to prevent print_arg_help from searching for aliases.
Originally, the ISL_ARG_END macro was used to signal the end of the array,
but this was replaced by ISL_ARGS_END, which cannot easily be used here,
at least not together with ISL_ARGS_START, because there is
no associated options structure.

Signed-off-by: Michael Kruse <isl@meinersbur.de>
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
isl_arg.c