diff --git a/module/zfs/zap_micro.c b/module/zfs/zap_micro.c index 1f32e44505..516d46ac7f 100644 --- a/module/zfs/zap_micro.c +++ b/module/zfs/zap_micro.c @@ -988,8 +988,10 @@ zap_lookup_impl(zap_t *zap, const char *name, } else { *(uint64_t *)buf = MZE_PHYS(zap, mze)->mze_value; - (void) strlcpy(realname, - MZE_PHYS(zap, mze)->mze_name, rn_len); + if (realname != NULL) + (void) strlcpy(realname, + MZE_PHYS(zap, mze)->mze_name, + rn_len); if (ncp) { *ncp = mzap_normalization_conflict(zap, zn, mze);