aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Quinot <thomas@FreeBSD.org>2007-04-05 20:31:23 +0000
committerThomas Quinot <thomas@FreeBSD.org>2007-04-05 20:31:23 +0000
commit993425ee98cb58a64b6a156b00a3fc6790c0e9cb (patch)
treec63783c533a6d8437aa674e37c12d4404717b03a
parent9760f68ca041927054d2759ea61e0bd71059cb64 (diff)
downloadsrc-993425ee98cb58a64b6a156b00a3fc6790c0e9cb.tar.gz
src-993425ee98cb58a64b6a156b00a3fc6790c0e9cb.zip
(bread): For a read that is contained entirely within a block, never copy
out more than size bytes to the caller's buffer. PR: bin/111191 Reviewed by: pb MFC after: 1 week
Notes
Notes: svn path=/head/; revision=168392
-rw-r--r--sbin/dump/traverse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c
index d3415b70b4e0..211cfa6370b9 100644
--- a/sbin/dump/traverse.c
+++ b/sbin/dump/traverse.c
@@ -925,7 +925,7 @@ loop:
cnt = cread(diskfd, tmpbuf, secsize, offset - base);
if (cnt != secsize)
goto bad;
- xfer = secsize - base;
+ xfer = MIN(secsize - base, size);
offset += xfer;
bytes -= xfer;
resid = bytes % secsize;