提交 f04c5b55 编写于 作者: M Michael Haggerty 提交者: Junio C Hamano

ref_transaction_create(): check that new_sha1 is valid

Creating a reference requires a new_sha1 that is not NULL and not
null_sha1.
Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: NStefan Beller <sbeller@google.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 a933c23e
......@@ -3690,6 +3690,8 @@ int ref_transaction_create(struct ref_transaction *transaction,
unsigned int flags, const char *msg,
struct strbuf *err)
{
if (!new_sha1 || is_null_sha1(new_sha1))
die("BUG: create called without valid new_sha1");
return ref_transaction_update(transaction, refname, new_sha1,
null_sha1, flags, msg, err);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册