Skip to content

pr-git-1299/chooglen/config/fix-sanitize-address-v1

From: Glen Choo <chooglen@google.com>

In read_protected_config(), check whether each file name is NULL before
attempting to read it. This mirrors do_git_config_sequence() (which
read_protected_config() is modelled after).

Without these NULL checks,

 make SANITIZE=address test T=t0410*.sh

fails because 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>

Submitted-As: https://lore.kernel.org/git/pull.1299.git.git.1658855372189.gitgitgadget@gmail.com
Assets 2