xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xenalyze: Use correct length when copying record into buffer
@ 2012-10-09 17:46 Boris Ostrovsky
  2012-10-10 13:34 ` George Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Boris Ostrovsky @ 2012-10-09 17:46 UTC (permalink / raw)
  To: George.Dunlap; +Cc: xen-devel

# HG changeset patch
# User Boris Ostrovsky <boris.ostrovsky@amd.com>
# Date 1349350810 14400
# Node ID ba18ab77da8ebe3c81ebf2c78c735cfcd40ea031
# Parent  4d47a8934b40556dd98428361c482be419c643be
xenalyze: Use correct length when copying record into buffer

mread64() calculates number of bytes to copied to avoid overrunning
target buffer but then doesn't use the calculated value.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>

diff -r 4d47a8934b40 -r ba18ab77da8e mread.c
--- a/mread.c	Wed Jun 20 16:54:17 2012 +0100
+++ b/mread.c	Thu Oct 04 07:40:10 2012 -0400
@@ -143,7 +143,7 @@ copy:
      dprintf(warn, " Using index %d, buffer at %p, buffer offset %llx 
len %d\n",
              bind, b, boffset, bsize);

-    bcopy(b+boffset, rec, len);
+    bcopy(b+boffset, rec, bsize);

      /* Handle the boundary case; make sure this is after doing anything
       * with the static variables*/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] xenalyze: Use correct length when copying record into buffer
  2012-10-09 17:46 [PATCH] xenalyze: Use correct length when copying record into buffer Boris Ostrovsky
@ 2012-10-10 13:34 ` George Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: George Dunlap @ 2012-10-10 13:34 UTC (permalink / raw)
  To: Boris Ostrovsky; +Cc: xen-devel

On Tue, Oct 9, 2012 at 6:46 PM, Boris Ostrovsky <boris.ostrovsky@amd.com> wrote:
> # HG changeset patch
> # User Boris Ostrovsky <boris.ostrovsky@amd.com>
> # Date 1349350810 14400
> # Node ID ba18ab77da8ebe3c81ebf2c78c735cfcd40ea031
> # Parent  4d47a8934b40556dd98428361c482be419c643be
> xenalyze: Use correct length when copying record into buffer
>
> mread64() calculates number of bytes to copied to avoid overrunning
> target buffer but then doesn't use the calculated value.
>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>

Good catch!  Thanks.  BTW, somehow this ended up with word-wrap and
whitespace damage -- I've fixed it and applied it anyway, but next
time can you try to use the mercurial patchbomb extension (hg email)?
(Making it an attachment is OK too, but setting up patchbomb is
definitely worth the effort.)

Thanks,
 -George

>
> diff -r 4d47a8934b40 -r ba18ab77da8e mread.c
> --- a/mread.c   Wed Jun 20 16:54:17 2012 +0100
> +++ b/mread.c   Thu Oct 04 07:40:10 2012 -0400
> @@ -143,7 +143,7 @@ copy:
>      dprintf(warn, " Using index %d, buffer at %p, buffer offset %llx len
> %d\n",
>              bind, b, boffset, bsize);
>
> -    bcopy(b+boffset, rec, len);
> +    bcopy(b+boffset, rec, bsize);
>
>      /* Handle the boundary case; make sure this is after doing anything
>       * with the static variables*/
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-10 13:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-09 17:46 [PATCH] xenalyze: Use correct length when copying record into buffer Boris Ostrovsky
2012-10-10 13:34 ` George Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).