Redacted Send/Receive causes zdb to dump core

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
This commit is contained in:
loli10K 2019-06-25 03:06:26 +02:00 committed by Brian Behlendorf
parent 746d4a451e
commit 5279ae918b

View 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);
}