X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=builtin-tar-tree.c;h=f6310b9032374d6fd262b807d85987465887cdbf;hb=9202434cbdfb123f41fc677bbf36ff21f6094fc8;hp=58a8ccd4d6af0d755fca28b06a12ca9b8efa5300;hpb=b642d9ef643371990c0a921836f2a074d48ce1b3;p=git.git diff --git a/builtin-tar-tree.c b/builtin-tar-tree.c index 58a8ccd4..f6310b90 100644 --- a/builtin-tar-tree.c +++ b/builtin-tar-tree.c @@ -240,8 +240,8 @@ static void write_entry(const unsigned char *sha1, struct strbuf *path, /* XXX: should we provide more meaningful info here? */ sprintf(header.uid, "%07o", 0); sprintf(header.gid, "%07o", 0); - strncpy(header.uname, "git", 31); - strncpy(header.gname, "git", 31); + safe_strncpy(header.uname, "git", sizeof(header.uname)); + safe_strncpy(header.gname, "git", sizeof(header.gname)); sprintf(header.devmajor, "%07o", 0); sprintf(header.devminor, "%07o", 0);