Skip to content

Commit

Permalink
Fix potential NULL pointer dereference in zfsdle_vdev_online()
Browse files Browse the repository at this point in the history
Coverity complained about this.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Chunwei Chen <david.chen@nutanix.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes openzfs#13903
  • Loading branch information
ryao authored and andrewc12 committed Oct 1, 2022
1 parent 7a740ae commit a0fefe9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/zed/agents/zfs_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a0fefe9

Please sign in to comment.