diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 4434f31a3591..0d3043f40d9e 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -2824,9 +2824,11 @@ dump_bookmarks(objset_t *os, int verbosity) zap_cursor_advance(&zc)) { char osname[ZFS_MAX_DATASET_NAME_LEN]; char buf[ZFS_MAX_DATASET_NAME_LEN]; + int len; dmu_objset_name(os, osname); - VERIFY3S(0, <=, snprintf(buf, sizeof (buf), "%s#%s", osname, - attr.za_name)); + len = snprintf(buf, sizeof (buf), "%s#%s", osname, + attr.za_name); + VERIFY3S(len, <, ZFS_MAX_DATASET_NAME_LEN); (void) dump_bookmark(dp, buf, verbosity >= 5, verbosity >= 6); } zap_cursor_fini(&zc);