btrfs-progs: fix overflow in btrfs_scan_one_dir()
authorZach Brown <zab@redhat.com>
Wed, 23 Jan 2013 19:31:24 +0000 (11:31 -0800)
committerZach Brown <zab@redhat.com>
Wed, 6 Feb 2013 00:09:39 +0000 (16:09 -0800)
commitde763395fb05bcd5c1ae32f9cd88d55cb396231c
treea544b469ccc48e623abbe6580017ff090c457fb8
parent506fb87fe48f38e2999b6265fcc54456ea81c7b1
btrfs-progs: fix overflow in btrfs_scan_one_dir()

btrfs_scan_one_dir() can overflow an arbitrarily small 256 byte buffer
with an arbitrarily slightly larger 1024 byte buffer as it remembers the
path of a dir to later descend.

Make these buffers the same size to stop the overflow and chose PATH_MAX
for that size so that it won't fail on legitimately bonkers paths.

Signed-off-by: Zach Brown <zab@redhat.com>
utils.c