diff mbox

[for-4.7] tools: xen-xsplice.c: fix length parameter of memset in list_func

Message ID 1462126905-25299-1-git-send-email-wei.liu2@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Liu May 1, 2016, 6:21 p.m. UTC
The length expression should be the same one used in malloc.

CID: 1358947

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 tools/misc/xen-xsplice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Konrad Rzeszutek Wilk May 2, 2016, 12:42 a.m. UTC | #1
On Sun, May 01, 2016 at 07:21:45PM +0100, Wei Liu wrote:
> The length expression should be the same one used in malloc.
> 
> CID: 1358947
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

> Cc: Ross Lagerwall <ross.lagerwall@citrix.com>
> ---
>  tools/misc/xen-xsplice.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/misc/xen-xsplice.c b/tools/misc/xen-xsplice.c
> index 0f1ab5a..b3bf048 100644
> --- a/tools/misc/xen-xsplice.c
> +++ b/tools/misc/xen-xsplice.c
> @@ -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 )
> -- 
> 2.1.4
>
Wei Liu May 2, 2016, 9:14 a.m. UTC | #2
On Sun, May 01, 2016 at 08:42:56PM -0400, Konrad Rzeszutek Wilk wrote:
> On Sun, May 01, 2016 at 07:21:45PM +0100, Wei Liu wrote:
> > The length expression should be the same one used in malloc.
> > 
> > CID: 1358947
> > 
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > ---
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 

Thanks for the quick response.

Queued.

> > Cc: Ross Lagerwall <ross.lagerwall@citrix.com>
> > ---
> >  tools/misc/xen-xsplice.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/misc/xen-xsplice.c b/tools/misc/xen-xsplice.c
> > index 0f1ab5a..b3bf048 100644
> > --- a/tools/misc/xen-xsplice.c
> > +++ b/tools/misc/xen-xsplice.c
> > @@ -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 )
> > -- 
> > 2.1.4
> >
diff mbox

Patch

diff --git a/tools/misc/xen-xsplice.c b/tools/misc/xen-xsplice.c
index 0f1ab5a..b3bf048 100644
--- a/tools/misc/xen-xsplice.c
+++ b/tools/misc/xen-xsplice.c
@@ -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 )