Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config.c: NULL check when reading protected config
In read_protected_config(), check whether each file name is NULL before attempting to read it, and add a BUG() call to git_config_from_file_with_options() to make this error easier to catch in the future. The NULL checks mirror what do_git_config_sequence() does (which read_protected_config() is modeled after). Without these NULL checks, multiple tests fail with "make SANITIZE=address", e.g. in the final test of t4010, xdg_config is NULL causing us to call fopen(NULL). Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Glen Choo <chooglen@google.com>
- Loading branch information