Re: [PATCH] Fix segfault for insane ident line
- From
Jiang Xin <worldhello.net@gmail.com>
- Date
- Apr 25, 2013, 10:52 UTC
- Message-ID
- <CANYiYbGC0VqtsPH8H4wmarJC-Y480+zE7irf1Y1RNLR2jA=EjA@mail.gmail.com>
- In-Reply-To
- <e7453e2b99517ebed045d82be4d5f2c9388bb002.1366885748.git.worldhello.net@gmail.com>
Oops, Ignore this patch please, I found they were already fixed by the following commits of next branch. Maybe next time I should patch something in next branch.
commit 9dbe7c3d7f4424cf0c27c2d4efabf72e58fa76b9 Author: René Scharfe <rene.scharfe@lsrfire.ath.cx> Date: Wed Apr 17 20:33:35 2013 +0200
pretty: handle broken commit headers gracefully
Centralize the parsing of the date and time zone strings in the new
helper function show_ident_date() and make sure it checks the pointers
provided by split_ident_line() for NULL before use. Reported-by: Ivan Lyapunov <dront78@gmail.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>commit de5abe9fe91a496d019d62abefe23df9d72fad30 Author: René Scharfe <rene.scharfe@lsrfire.ath.cx> Date: Wed Apr 17 20:33:54 2013 +0200
blame: handle broken commit headers gracefully
split_ident_line() can leave us with the pointers date_begin, date_end,
tz_begin and tz_end all set to NULL. Check them before use and supply
the same fallback values as in the case of a negative return code from
split_ident_line(). The "(unknown)" is not actually shown in the output, though, because it
will be converted to a number (zero) eventually.Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
-- 蒋鑫
北京群英汇信息技术有限公司 邮件: worldhello.net@gmail.com 网址: http://www.ossxp.com/ 博客: http://www.worldhello.net/ 微博: http://weibo.com/gotgit/ 电话: 18601196889