diff options
author | Jeff King <peff@peff.net> | 2023-12-07 10:11:32 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-12-09 02:24:47 +0300 |
commit | 1b274c98341ef17f3bbfe80f603f629e7c950668 (patch) | |
tree | 77116aa5747296a1210b131c46184992133c9119 /fsck.c | |
parent | 34b1a0d320e3a1531997d6681bacffbe9da7a046 (diff) |
trailer: handle NULL value when parsing trailer-specific config
When parsing the "key", "command", and "cmd" trailer config, we just
make a copy of the value string. If we see an implicit bool like:
[trailer "foo"]
key
we'll segfault trying to copy a NULL pointer. We can fix this with the
usual config_error_nonbool() check.
I split this out from the other vanilla cases, because at first glance
it looks like a better fix here would be to move the NULL check out of
the switch statement. But it would change the behavior of other keys
like trailer.*.ifExists, where an implicit bool is interpreted as
EXISTS_DEFAULT.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsck.c')
0 files changed, 0 insertions, 0 deletions