diff options
author | Hannes Reinecke <hare@suse.de> | 2011-05-18 09:24:29 +0200 |
---|---|---|
committer | Hannes Reinecke <hare@suse.de> | 2011-05-18 09:24:29 +0200 |
commit | 9571edeccd3f6922b6d4f357f8b3028573f58521 (patch) | |
tree | 9153ab3a126ad533c250ab27d921dc23e2b44931 | |
parent | 8c6038a94c06bbd329db4bb6e20d33c64f483f93 (diff) | |
download | multipath-tools-9571edeccd3f6922b6d4f357f8b3028573f58521.tar.gz |
libmultipath: zero out sense buffer in do_inq()
We should be zero out the sense buffer when doing an inquiry
so as not to have invalid contents being passed up.
Signed-off-by: Hannes Reinecke <hare@suse.de>
-rw-r--r-- | libmultipath/discovery.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index b5e2e4f..a7a8e94 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -346,6 +346,7 @@ do_inq(int sg_fd, int cmddt, int evpd, unsigned int pg_op, inqCmdBlk[3] = (unsigned char)((mx_resp_len >> 8) & 0xff); inqCmdBlk[4] = (unsigned char) (mx_resp_len & 0xff); memset(&io_hdr, 0, sizeof (struct sg_io_hdr)); + memset(sense_b, 0, SENSE_BUFF_LEN); io_hdr.interface_id = 'S'; io_hdr.cmd_len = sizeof (inqCmdBlk); io_hdr.mx_sb_len = sizeof (sense_b); |