Skip to contentSkip to conversation

multipath-tools/path_priority/pp_alua rtpg.c

PATCH [email protected] 1 participant 1 message Oct 26, 2011 Device mapper

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: [email protected] 2011-10-26 04:53:44

Modified files:
path_priority/pp_alua: rtpg.c

Log message:
Fix for bz #740512. zero out buffers for do_inquiry and do_rtpg.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/path_priority/pp_alua/rtpg.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.3.2.6&r2=1.3.2.7

path_priority/pp_alua/rtpg.c +4 -0
@@ -165,6 +165,7 @@
 	struct inquiry_data	inq;
 	int			rc;
 
+	memset((unsigned char *)&inq, 0, sizeof(inq));
 	rc = do_inquiry(fd, 0, 0x00, &inq, sizeof(inq));
 	if (!rc) {
 		rc = inquiry_data_get_tpgs(&inq);
@@ -181,6 +182,7 @@
 	struct vpd83_dscr *	dscr;
 	int			rc;
 
+	memset(buf, 0, sizeof(buf));
 	rc = do_inquiry(fd, 1, 0x83, buf, sizeof(buf));
 	if (!rc) {
 		vpd83 = (struct vpd83_data *) buf;
@@ -266,6 +268,7 @@
 			"%u bytes\n", buflen);
 		return -RTPG_RTPG_FAILED;
 	}
+	memset(buf, 0, buflen);
 	rc = do_rtpg(fd, buf, buflen);
 	if (rc < 0)
 		goto out;
@@ -279,6 +282,7 @@
 			return -RTPG_RTPG_FAILED;
 		}
 		buflen = scsi_buflen;
+		memset(buf, 0, buflen);
 		rc = do_rtpg(fd, buf, buflen);
 		if (rc < 0)
 			goto out;