Skip to contentSkip to conversation

mpathpersist: memset length is wrong

PATCH In review [email protected] 2 participants 3 messages Sep 21, 2016 – Oct 11, 2016 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpathpersist: memset length is wrong

From: "tang.junhui" <[email protected]>

variable transportids is cleared by memset() with wrong length MPATH_MX_TIDS, the length should be MPATH_MX_TIDS*sizeof(struct transportid).

---
 mpathpersist/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mpathpersist/main.c +1 -1
index a55865f..8e8cc35 100644
@@ -105,7 +105,7 @@ int main (int argc, char * argv[])
 
 	udev = udev_new();
 	conf = mpath_lib_init(udev);
-	memset(transportids,0,MPATH_MX_TIDS);
+	memset(transportids, 0, MPATH_MX_TIDS * sizeof(struct transportid));
 	multipath_conf = conf;
 
 	while (1)
Signature · 1 line
2.8.1.windows.1
#1 lore raw

Please have a review for this patch, any comment will be highly appreciated.

发件人: [email protected]
收件人: christophe varoqui <[email protected]>,
[email protected], Vijay <[email protected]>, Benjamin Marzinski <[email protected]>,
抄送: [email protected], [email protected], "tang.junhui"
<[email protected]>
日期: 2016/09/21 16:54
主题: [dm-devel] [PATCH] mpathpersist: memset length is wrong
发件人: [email protected]

From: "tang.junhui" <[email protected]>

variable transportids is cleared by memset() with wrong length MPATH_MX_TIDS,
the length should be MPATH_MX_TIDS*sizeof(struct transportid).

---
 mpathpersist/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mpathpersist/main.c +1 -1
index a55865f..8e8cc35 100644
@@ -105,7 +105,7 @@ int main (int argc, char * argv[])
 
                 udev = udev_new();
                 conf = mpath_lib_init(udev);
-                memset(transportids,0,MPATH_MX_TIDS);
+                memset(transportids, 0, MPATH_MX_TIDS * sizeof(struct 
transportid));
                 multipath_conf = conf;
 
                 while (1)
Signature · 6 lines
2.8.1.windows.1

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
#2 lore raw

Seems right.
Merged, with thanks.

Quoted 53 lines · On Tue, Oct 11, 2016 at 8:37 AM, <[email protected]> wrote:

Please have a review for this patch, any comment will be highly appreciated.

发件人: [email protected]
收件人: christophe varoqui <[email protected]>,
[email protected], Vijay <[email protected]>, Benjamin Marzinski < [email protected]>,
抄送: [email protected], [email protected], "tang.junhui" <
[email protected]>
日期: 2016/09/21 16:54
主题: [dm-devel] [PATCH] mpathpersist: memset length is wrong
发件人: [email protected]
------------------------------

From: "tang.junhui" <[email protected]>

variable transportids is cleared by memset() with wrong length MPATH_MX_TIDS,
the length should be MPATH_MX_TIDS*sizeof(struct transportid).

---
mpathpersist/main.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
mpathpersist/main.c +1 -1
index a55865f..8e8cc35 100644
@@ -105,7 +105,7 @@ int main (int argc, char * argv[])
 
                 udev = udev_new();
                 conf = mpath_lib_init(udev);
-                 memset(transportids,0,MPATH_MX_TIDS);
+                 memset(transportids, 0, MPATH_MX_TIDS * sizeof(struct
 transportid));
                 multipath_conf = conf;
 
                 while (1)

--
2.8.1.windows.1

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel