Skip to contentSkip to conversation

tools: xen-xsplice.c: fix length parameter of memset in list_func

PATCH In review Wei Liu 2 participants 3 messages May 1, 2016 – May 2, 2016

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 tools: xen-xsplice.c: fix length parameter of memset in list_func

The length expression should be the same one used in malloc.

CID: 1358947

---
Cc: Ian Jackson <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Ross Lagerwall <[email protected]>

---
 tools/misc/xen-xsplice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/misc/xen-xsplice.c +1 -1
index 0f1ab5a..b3bf048 100644
@@ -95,7 +95,7 @@ static int list_func(int argc, char *argv[])
         done = 0;
         /* The memset is done to catch errors. */
         memset(info, 'A', sizeof(*info) * MAX_LEN);
-        memset(name, 'B', sizeof(*name * MAX_LEN * XEN_XSPLICE_NAME_SIZE));
+        memset(name, 'B', sizeof(*name) * MAX_LEN * XEN_XSPLICE_NAME_SIZE);
         memset(len, 'C', sizeof(*len) * MAX_LEN);
         rc = xc_xsplice_list(xch, MAX_LEN, idx, info, name, len, &done, &left);
         if ( rc )
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Wei Liu

The length expression should be the same one used in malloc.

CID: 1358947

---
Cc: Ian Jackson <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>

Quoted 21 lines
Cc Ross Lagerwall <[email protected]>
---
 tools/misc/xen-xsplice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/misc/xen-xsplice.c +1 -1
index 0f1ab5a..b3bf048 100644
@@ -95,7 +95,7 @@ static int list_func(int argc, char *argv[])
         done = 0;
         /* The memset is done to catch errors. */
         memset(info, 'A', sizeof(*info) * MAX_LEN);
-        memset(name, 'B', sizeof(*name * MAX_LEN * XEN_XSPLICE_NAME_SIZE));
+        memset(name, 'B', sizeof(*name) * MAX_LEN * XEN_XSPLICE_NAME_SIZE);
         memset(len, 'C', sizeof(*len) * MAX_LEN);
         rc = xc_xsplice_list(xch, MAX_LEN, idx, info, name, len, &done, &left);
         if ( rc )
Signature · 1 line
2.1.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#2 lore raw
Quoted 12 lines · Konrad Rzeszutek Wilk
Quoted 8 lines · Wei Liu

The length expression should be the same one used in malloc.

CID: 1358947

---
Cc: Ian Jackson <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>

Thanks for the quick response.

Queued.

Quoted 5 lines
Quoted 5 lines
Cc Ross Lagerwall <[email protected]>
---
 tools/misc/xen-xsplice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 16 lines
tools/misc/xen-xsplice.c +1 -1
index 0f1ab5a..b3bf048 100644
@@ -95,7 +95,7 @@ static int list_func(int argc, char *argv[])
         done = 0;
         /* The memset is done to catch errors. */
         memset(info, 'A', sizeof(*info) * MAX_LEN);
-        memset(name, 'B', sizeof(*name * MAX_LEN * XEN_XSPLICE_NAME_SIZE));
+        memset(name, 'B', sizeof(*name) * MAX_LEN * XEN_XSPLICE_NAME_SIZE);
         memset(len, 'C', sizeof(*len) * MAX_LEN);
         rc = xc_xsplice_list(xch, MAX_LEN, idx, info, name, len, &done, &left);
         if ( rc )
Signature · 1 line
2.1.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel