From 7b1318af88e210609b16025b5fc7613f3f6e0fdf Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Tue, 20 Sep 2022 18:20:04 -0400 Subject: [PATCH] Fix potential NULL pointer dereference in zfsdle_vdev_online() Coverity complained about this. Reviewed-by: Brian Behlendorf Reviewed-by: Chunwei Chen Signed-off-by: Richard Yao Closes #13903 --- cmd/zed/agents/zfs_mod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/zed/agents/zfs_mod.c b/cmd/zed/agents/zfs_mod.c index af6de73a1cc1..53d9ababded9 100644 --- a/cmd/zed/agents/zfs_mod.c +++ b/cmd/zed/agents/zfs_mod.c @@ -965,7 +965,7 @@ zfsdle_vdev_online(zpool_handle_t *zhp, void *data) nvlist_t *tgt; int error; - char *tmp_devname, devname[MAXPATHLEN]; + char *tmp_devname, devname[MAXPATHLEN] = ""; uint64_t guid; if (nvlist_lookup_uint64(udev_nvl, ZFS_EV_VDEV_GUID, &guid) == 0) {