Merge branch 'js/fsck-tag-validation'

New tag object format validation added in 2.2 showed garbage
after a tagname it reported in its error message.

* js/fsck-tag-validation:
  index-pack: terminate object buffers with NUL
  fsck: properly bound "invalid tag name" error message
This commit is contained in:
Junio C Hamano
2014-12-22 12:27:41 -08:00
4 changed files with 11 additions and 6 deletions

3
fsck.c
View File

@ -426,7 +426,8 @@ static int fsck_tag_buffer(struct tag *tag, const char *data,
}
strbuf_addf(&sb, "refs/tags/%.*s", (int)(eol - buffer), buffer);
if (check_refname_format(sb.buf, 0))
error_func(&tag->object, FSCK_WARN, "invalid 'tag' name: %s", buffer);
error_func(&tag->object, FSCK_WARN, "invalid 'tag' name: %.*s",
(int)(eol - buffer), buffer);
buffer = eol + 1;
if (!skip_prefix(buffer, "tagger ", &buffer))