git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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
Previous: drafnel@gmail.com
Message 13 of 13 in “mktag.c: adjust verify_tag parameters”
  1. 1/5 mktag.c: adjust verify_tag parametersdrafnel@gmail.com, May 9, 2008
  2. Junio C HamanoMay 11, 2008
  3. Brandon CaseyMay 12, 2008
  4. 2/5 Make mktag a builtin.drafnel@gmail.com, May 9, 2008
  5. Junio C HamanoMay 11, 2008
  6. Junio C HamanoMay 11, 2008
  7. Brandon CaseyMay 12, 2008
  8. Johannes SchindelinMay 12, 2008
  9. Brandon CaseyMay 12, 2008
  10. Junio C HamanoMay 12, 2008
  11. 3/5 mktag.c: rename verify_tag to verify_tag_bufferdrafnel@gmail.com, May 9, 2008
  12. 4/5 mktag.c: consolidate tag functions by merging mktag.c into builtin-tag.cdrafnel@gmail.com, May 9, 2008
  13. 5/5 git-tag: call verify_tag_buffer to validate the generated tag objectdrafnel@gmail.com, May 9, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.