[PATCH 5/5] git-tag: call verify_tag_buffer to validate the generated tag object
- From
drafnel@gmail.com <drafnel@gmail.com>
- Date
- May 9, 2008, 02:19 UTC
- Message-ID
- <859967.1210299539642.JavaMail.teamon@b301.teamon.com>
- In-Reply-To
- <1210299589-10448-5-git-send-email-drafnel@example.com>
From: Brandon Casey <drafnel@gmail.com>
This will ensure that both git-tag and git-mktag "produce valid tags, with the same definition of validity."
Signed-off-by: Brandon Casey <drafnel@gmail.com> --- builtin-tag.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/builtin-tag.c b/builtin-tag.c index 85ec2f3..0f79d47 100644 --- a/builtin-tag.c +++ b/builtin-tag.c @@ -508,6 +508,8 @@ static void create_tag(const unsigned char *object, const char *tag, if (sign && do_sign(buf) < 0) die("unable to sign the tag"); + if (verify_tag_buffer(buf->buf, buf->len) < 0) + die("invalid tag object"); if (write_sha1_file(buf->buf, buf->len, tag_type, result) < 0) die("unable to write tag file"); }
-- 1.5.5.67.g9a49