Skip to contentSkip to conversation

xenalyze: Use correct length when copying record into buffer

PATCH In review Boris Ostrovsky 2 participants 2 messages Oct 9, 2012 – Oct 10, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xenalyze: Use correct length when copying record into buffer

# HG changeset patch
# User Boris Ostrovsky <[email protected]>
# 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.

mread.c +0 -0
diff -r 4d47a8934b40 -r ba18ab77da8e mread.c
@@ -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*/

#1 lore raw
Quoted 11 lines · Boris Ostrovsky

# HG changeset patch
# User Boris Ostrovsky <[email protected]>
# 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.

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

Quoted 20 lines

diff -r 4d47a8934b40 -r ba18ab77da8e mread.c

mread.c Thu Oct 04 07:40:10 2012 -0400 renamed from mread.c Wed Jun 20 16:54:17 2012 +0100 +1 -1
@@ -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
[email protected]
http://lists.xen.org/xen-devel