Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix null dereferences on unset format strings
Prior to this commit, argv_format() reported success but left its output string as null in some cases. For example, this happened when the format string was "%(cmdlineargs)" and the corresponding option ("opt_cmdline_args") was null. Some callers checked if the output string was null, but others didn't. As a result, the following two commands would crash Tig :!%(cmdlineargs) :echo %(cmdlineargs) Fix the root of the problem by making argv_format() fail whenever its output string is null. This works better for most callers. Now instead of crashing, ":echo %(cmdlineargs)" fails, which is debatable. In future this could be improved to print an empty string, however, we should take care to still report errors on ":echo %(invalid)".
- Loading branch information