@@ -105,6 +105,7 @@ int hds_modular_prio (const char *dev, int fd)
}
memset (&io_hdr, 0, sizeof (sg_io_hdr_t));
+ memset (inqBuff, 0, INQ_REPLY_LEN);
io_hdr.interface_id = 'S';
io_hdr.cmd_len = sizeof (inqCmdBlk);
io_hdr.mx_sb_len = sizeof (sense_buffer);
@@ -80,6 +80,7 @@ static int send_gva(const char *dev, int fd, unsigned char pg,
int ret = -1;
memset(&io_hdr, 0, sizeof (struct sg_io_hdr));
+ memset(results, 0, *results_size);
io_hdr.interface_id = 'S';
io_hdr.cmd_len = sizeof (cdb);
io_hdr.mx_sb_len = sizeof (sb);
@@ -22,6 +22,7 @@ int rdac_prio(const char *dev, int fd)
int ret = 0;
memset(&io_hdr, 0, sizeof (struct sg_io_hdr));
+ memset(sense_buffer, 0, 256);
io_hdr.interface_id = 'S';
io_hdr.cmd_len = sizeof (inqCmdBlk);
io_hdr.mx_sb_len = sizeof (sb);
Declaring an array does not zero out its contents. So we might be reading random garbage here. Signed-off-by: Hannes Reinecke <hare@suse.de> --- libmultipath/prioritizers/hds.c | 1 + libmultipath/prioritizers/ontap.c | 1 + libmultipath/prioritizers/rdac.c | 1 + 3 files changed, 3 insertions(+), 0 deletions(-)