提交 a2678df3 编写于 作者: S Stefan Naewe 提交者: Junio C Hamano

revision.c: fix possible null pointer arithmetic

mark_tree_uninteresting() dereferences a tree pointer before
checking if the pointer is valid. Fix that by doing the check first.
Signed-off-by: NStefan Naewe <stefan.naewe@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 24358560
......@@ -131,10 +131,12 @@ static void mark_tree_contents_uninteresting(struct tree *tree)
void mark_tree_uninteresting(struct tree *tree)
{
struct object *obj = &tree->object;
struct object *obj;
if (!tree)
return;
obj = &tree->object;
if (obj->flags & UNINTERESTING)
return;
obj->flags |= UNINTERESTING;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册