diff options
author | Glen Choo <chooglen@google.com> | 2022-07-26 22:21:06 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-07-27 06:46:01 (GMT) |
commit | 776f184893d2861a729aa4b91d69931036e03e4b (patch) | |
tree | 0e00417cf5c0af3a2759eb80a7817f4fb5b32fd9 /t/helper/test-delta.c | |
parent | 8d1a7448206e11cdea657c35b04cc49db39be933 (diff) | |
download | git-776f184893d2861a729aa4b91d69931036e03e4b.zip git-776f184893d2861a729aa4b91d69931036e03e4b.tar.gz git-776f184893d2861a729aa4b91d69931036e03e4b.tar.bz2 |
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-delta.c')
0 files changed, 0 insertions, 0 deletions