fsck: use strbuf to generate alternate directories
commitc1fd0809174a31edd17e97c1161e01907f41a4fc
authorJeff King <peff@peff.net>
Thu, 24 Sep 2015 21:05:48 +0000 (24 17:05 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 Sep 2015 17:18:18 +0000 (25 10:18 -0700)
tree31191c73a687b308391c621faa6a3e66b441527f
parentaf49c6d0918bf04aad89bd885a4eef5767a33d0e
fsck: use strbuf to generate alternate directories

When fsck-ing alternates, we make a copy of the alternate
directory in a fixed PATH_MAX buffer. We memcpy directly,
without any check whether we are overflowing the buffer.
This is OK if PATH_MAX is a true representation of the
maximum path on the system, because any path here will have
already been vetted by the alternates subsystem. But that is
not true on every system, so we should be more careful.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsck.c