plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit 2763a6d8324fc5e1296e9a50a067ec04d52c581f
parent 72197f89d47444e3c62e1aa0df8bd7059c29104d
Author: Russ Cox <rsc@swtch.com>
Date:   Tue, 21 Oct 2014 07:25:13 -0400

venti/copy: fix bug writing directories that zero truncate

Found by nwf.

TBR=rsc
https://codereview.appspot.com/162860045

Diffstat:
MCONTRIBUTORS | 1+
Msrc/cmd/venti/copy.c | 2+-
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CONTRIBUTORS b/CONTRIBUTORS @@ -37,6 +37,7 @@ Mathieu Lonjaret <lejatorn@gmail.com> Mathieu Lonjaret <mathieu.lonjaret@gmail.com> Michael Teichgräber <mt4swm@googlemail.com> Michael Teichgräber <mt@ib.wmipf.de> +Nathaniel W Filardo <nwf@cs.jhu.edu> <nwfilardo@gmail.com> Nikolai Saoukh <nikolai.saoukh@gmail.com> Yuval Pavel Zholkover <paulzhol@gmail.com> Peter Saveliev <svinota.saveliev@gmail.com> diff --git a/src/cmd/venti/copy.c b/src/cmd/venti/copy.c @@ -136,7 +136,7 @@ walk(uchar score[VtScoreSize], uint type, int base, int depth) break; case VtDirType: - for(i=0; i<n/VtEntrySize; i++){ + for(i=0; i*VtEntrySize < n; i++){ if(vtentryunpack(&e, buf, i) < 0){ fprint(2, "warning: could not unpack entry #%d in %V %d\n", i, score, type); continue;