Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
len += 4;
}
+ /*
+ * add_packed_git() uses our buffer (containing "foo.idx") to
+ * build the pack filename ("foo.pack"). Make sure it fits.
+ */
+ if (len + 1 >= PATH_MAX) {
+ arg[len - 4] = '\0';
+ return error("name too long: %s.pack", arg);
+ }
+
pack = add_packed_git(arg, len, 1);
if (!pack)
return error("packfile %s not found.", arg);