Sync with maint
[gitweb.git] / convert.c
index f3bd3e93fb2ecf95413db3c53d7e686cd03d1e69..814e814438b7c0f4f84850787670766fb4765f08 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -1289,7 +1289,8 @@ static struct stream_filter *ident_filter(const unsigned char *sha1)
 {
        struct ident_filter *ident = xmalloc(sizeof(*ident));
 
-       sprintf(ident->ident, ": %s $", sha1_to_hex(sha1));
+       xsnprintf(ident->ident, sizeof(ident->ident),
+                 ": %s $", sha1_to_hex(sha1));
        strbuf_init(&ident->left, 0);
        ident->filter.vtbl = &ident_vtbl;
        ident->state = 0;