From: Hannes Reinecke Date: Wed, 18 May 2011 07:24:29 +0000 (+0200) Subject: libmultipath: zero out sense buffer in do_inq() X-Git-Tag: upstream/0.5.0~106^2~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9571edeccd3f6922b6d4f357f8b3028573f58521;p=platform%2Fupstream%2Fmultipath-tools.git 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 --- 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);