From fd074864c4cc319f1969b9b3513cef654a6648ea Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 14 Aug 2013 16:16:35 -0700 Subject: btrfs-progs: remove variable length stack arrays sparse hates variable length array definitions on the stack: btrfs-show-super.c:155:21: warning: Variable length array is used. And it's right to. They're a fragile construct that doesn't handle bad input well at all. Signed-off-by: Zach Brown Signed-off-by: David Sterba Signed-off-by: Chris Mason --- btrfs-show-super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'btrfs-show-super.c') diff --git a/btrfs-show-super.c b/btrfs-show-super.c index c2e844d..0c3c73c 100644 --- a/btrfs-show-super.c +++ b/btrfs-show-super.c @@ -152,7 +152,7 @@ static int load_and_dump_sb(char *filename, int fd, u64 sb_bytenr) static int check_csum_sblock(void *sb, int csum_size) { - char result[csum_size]; + char result[BTRFS_CSUM_SIZE]; u32 crc = ~(u32)0; crc = btrfs_csum_data(NULL, (char *)sb + BTRFS_CSUM_SIZE, -- cgit v1.2.1