]> granicus.if.org Git - zfs/commitdiff
Redacted Send/Receive causes zdb to dump core
authorloli10K <loli10K@users.noreply.github.com>
Tue, 25 Jun 2019 01:06:26 +0000 (03:06 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 25 Jun 2019 01:06:26 +0000 (18:06 -0700)
When used with verbosity >= 4 zdb fails an assertion in dump_bookmarks()
because it expects snprintf() to retun 0 on success.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #8948

cmd/zdb/zdb.c

index 3194fd08203b10c62c03c97cb4879989e36c0374..969c8f1b794c3f8f45c046e5894ea0dcb53a95f0 100644 (file)
@@ -1939,7 +1939,7 @@ dump_bookmarks(objset_t *os, int verbosity)
                char osname[ZFS_MAX_DATASET_NAME_LEN];
                char buf[ZFS_MAX_DATASET_NAME_LEN];
                dmu_objset_name(os, osname);
-               VERIFY0(snprintf(buf, sizeof (buf), "%s#%s", osname,
+               VERIFY3S(0, <=, snprintf(buf, sizeof (buf), "%s#%s", osname,
                    attr.za_name));
                (void) dump_bookmark(dp, buf, verbosity >= 5, verbosity >= 6);
        }