btrfs-progs: show-super: copy implementation of btrfs_read_sys_array
authorDavid Sterba <dsterba@suse.com>
Mon, 30 Nov 2015 16:56:58 +0000 (17:56 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 4 Jan 2016 10:28:24 +0000 (11:28 +0100)
commit88f584cfea4d8170de07acbf67895fe992d0afc4
tree49c2bb80892d4380c9fb9b8fac81ac57ac85a75a
parent5f03d1fc23a575988c33098d4dea828bc19c1db6
btrfs-progs: show-super: copy implementation of btrfs_read_sys_array

btrfs-show-super has own implementation to read the sys array and it
lacks all the sanity checks.

Copy and adapt the improved implementation from btrfs_read_sys_array.
This will fix crashes on a fuzzed/corrupted images. It's duplicating
code but at the moment looks easier than refactoring and restructuring
btrfs_read_sys_array that now almost matches the kernel code, which we
want in the long term.

Signed-off-by: David Sterba <dsterba@suse.com>
btrfs-show-super.c