Skip to content

Instantly share code, notes, and snippets.

@lundman
Created October 30, 2017 07:31
Show Gist options
  • Save lundman/fb6615c3a20859a6da5380c556971c55 to your computer and use it in GitHub Desktop.
Save lundman/fb6615c3a20859a6da5380c556971c55 to your computer and use it in GitHub Desktop.
zdb fix
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index 1996fd1632c..e50147a98da 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -3776,9 +3776,11 @@ zdb_embedded_block(char *thing)
{
blkptr_t bp = { { { { 0 } } } };
unsigned long long *words = (void *)&bp;
- char buf[SPA_MAXBLOCKSIZE];
+ char *buf;
int err;
+ buf = malloc(SPA_MAXBLOCKSIZE);
+
err = sscanf(thing, "%llx:%llx:%llx:%llx:%llx:%llx:%llx:%llx:"
"%llx:%llx:%llx:%llx:%llx:%llx:%llx:%llx",
words + 0, words + 1, words + 2, words + 3,
@@ -3796,6 +3798,7 @@ zdb_embedded_block(char *thing)
exit(1);
}
zdb_dump_block_raw(buf, BPE_GET_LSIZE(&bp), 0);
+ free(buf);
}
static boolean_t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment