path: root/btrfs-show-super.c
diff options
authorZach Brown <>2013-08-14 16:16:35 -0700
committerDavid Sterba <>2013-09-03 19:41:03 +0200
commitfd074864c4cc319f1969b9b3513cef654a6648ea (patch)
tree5bfce93cc02d87c9427efa9473b0d4180ea11f23 /btrfs-show-super.c
parent19a2e1f4611eeff9668dacecafb6e51b5ca0f704 (diff)
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 <>
Diffstat (limited to 'btrfs-show-super.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/btrfs-show-super.c b/btrfs-show-super.c
index c2e844de..0c3c73c9 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,