From 005c63c44963f5d7864045ce019744c492d42b04 Mon Sep 17 00:00:00 2001 From: Sarah Ahmed Date: Mon, 27 Jul 2026 11:07:36 -0500 Subject: [PATCH] netapp-nvme: fix uninitialized pointer in netapp_smdevices() The netapp_smdevices() function declares the devices pointer used to receive the scandir() output, but does not initialize it before passing its address to scandir(). If execution reaches the scandir() call with devices holding an indeterminate stack value, the behavior is undefined. Initialize devices to NULL so it holds a defined value before scandir() writes to it through the pointer. Signed-off-by: Sarah Ahmed --- plugins/netapp/netapp-nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/netapp/netapp-nvme.c b/plugins/netapp/netapp-nvme.c index a96d09b213..2c404dca9d 100644 --- a/plugins/netapp/netapp-nvme.c +++ b/plugins/netapp/netapp-nvme.c @@ -906,7 +906,7 @@ static int netapp_smdevices(int argc, char **argv, struct command *acmd, { const char *desc = "Display information about E-Series volumes."; __cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL; - struct dirent **devices; + struct dirent **devices = NULL; int num, i, ret, fmt; struct smdevice_info *smdevices; char path[264];