From: Jeff King Date: Thu, 16 Mar 2017 14:27:15 +0000 (-0400) Subject: replace snprintf with odb_pack_name() X-Git-Tag: v2.12.3~12^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/ba47a3088f04ac3d2833bea56ee366be1054db8d?ds=inline;hp=ba47a3088f04ac3d2833bea56ee366be1054db8d replace snprintf with odb_pack_name() In several places we write the name of the pack filename into a fixed-size buffer using snprintf(), but do not check the return value. As a result, a very long object directory could cause us to quietly truncate the pack filename (potentially leading to a corrupted repository, as a newly written packfile could be missing its .pack extension). We can use odb_pack_name() to do this with a strbuf (and shorten the code, as well). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano ---