Thread (1 message) 1 message, 1 author, 2016-06-15
DORMANTno replies

[PATCH 5/5] git-tag: call verify_tag_buffer to validate the generated tag object

From: <hidden>
Date: 2016-06-15 22:44:35
Subsystem: the rest · Maintainer: Linus Torvalds

From: Brandon Casey <redacted>

This will ensure that both git-tag and git-mktag "produce valid tags,
with the same definition of validity."

Signed-off-by: Brandon Casey <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help