btrfs-progs: don't overflow read buffer in image
authorZach Brown <zab@redhat.com>
Mon, 7 Oct 2013 21:42:57 +0000 (14:42 -0700)
committerChris Mason <chris.mason@fusionio.com>
Wed, 16 Oct 2013 12:23:13 +0000 (08:23 -0400)
commit69dc09a3ce7e914111c1cf9da93021d9b5d51762
tree43561af432b0fedc0a30b32524839771cd9b2af5
parent961eaa7d3975928635e3dc775e6ab3a2f36a5303
btrfs-progs: don't overflow read buffer in image

search_for_chunk_blocks() allocates a fixed-size buffer and then reads
arbitrary u32 sized buffers in to it.  Instead let's fail if the item is
bigger than the buffer.  This was found by static analysis.

Signed-off-by: Zach Brown <zab@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
btrfs-image.c