diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c index 7ea4d50eaf7..ac3927cc243 100644 --- a/sbin/reboot/reboot.c +++ b/sbin/reboot/reboot.c @@ -130,6 +130,11 @@ write_nextboot(const char *fn, const char *env, bool force) } if (zfs) { + char *slash; + + if ((slash = strchr(sfs.f_mntfromname, '/')) == NULL) + E("Can't find ZFS pool name in %s", sfs.f_mntfromname); + *slash = '\0'; zfsbootcfg(sfs.f_mntfromname, force); }