mirror of
https://github.com/git/git.git
synced 2025-12-23 12:14:22 +01:00
As we parse the author-script file, we check for missing or duplicate lines for GIT_AUTHOR_NAME, etc. But after reading the whole file, our final error conditional checks "date_i" twice and "name_i" not at all. This not only leads to us failing to abort, but we may do an out-of-bounds read on the string_list array. The bug goes back to442c36bd08(am: improve author-script error reporting, 2018-10-31), though the code was soon after moved to this spot bybcd33ec25f(add read_author_script() to libgit, 2018-10-31). It was presumably just a typo in442c36bd08. We'll add test coverage for all the error cases here, though only the GIT_AUTHOR_NAME ones fail (even in a vanilla build they segfault consistently, but certainly with SANITIZE=address). Reported-by: Michael V. Scovetta <michael.scovetta@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1.2 KiB
Executable File
1.2 KiB
Executable File