diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2018-07-31 03:33:31 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-31 11:35:00 -0700 |
commit | 5522bbac2059283f7a91fa367fb1eb75faec2f3d (patch) | |
tree | 5ade8863b5c0ec9c7a7f2afc6529c3212be9dcd0 /color.c | |
parent | sequencer: fix "rebase -i --root" corrupting author header timestamp (diff) | |
download | tgif-5522bbac2059283f7a91fa367fb1eb75faec2f3d.tar.xz |
sequencer: don't die() on bogus user-edited timestamp
read_author_ident() is careful to handle errors "gently" when parsing
"rebase-merge/author-script" by printing a suitable warning and
returning NULL; it never die()'s. One possible reason that parsing might
fail is that "rebase-merge/author-script" has been hand-edited in such a
way which corrupts it or the information it contains.
However, read_author_ident() invokes fmt_ident() which is not so careful
about failing "gently". It will die() if it encounters a malformed
timestamp. Since read_author_ident() doesn't want to die() and since
it's dealing with possibly hand-edited data, take care to avoid passing
a bogus timestamp to fmt_ident().
A more "correctly engineered" fix would be to add a "gentle" version of
fmt_ident(), however, such a change it outside the scope of the bug-fix
series. If fmt_ident() ever does grow a "gentle" cousin, then the manual
timestamp check added here can be retired.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'color.c')
0 files changed, 0 insertions, 0 deletions