about summary refs log tree commit diff
path: root/tvix/store/src/blobservice/memory.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-06-30T11·50+0200
committerclbot <clbot@tvl.fyi>2023-06-30T12·30+0000
commit6604ce4e512208ec559c5c0b295fbe14fcac87cf (patch)
tree94e132521cb1c326f94d78d2927079dde165acc5 /tvix/store/src/blobservice/memory.rs
parentf5e291cf8328096d790f5416cf1968cb9164220a (diff)
fix(tvix/store/blobservice): write into hasher from b, not buf r/6367
buf contains everything written so far, whereas b is the slice passed in
the current write() call. If we copy from &buf, we end up with the wrong
hash, because we keep writing the wrong data to the hash function.

Change-Id: I768d4645934a6a7d75b9c8eeba35f8f3be5edd26
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8880
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/store/src/blobservice/memory.rs')
-rw-r--r--tvix/store/src/blobservice/memory.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/store/src/blobservice/memory.rs b/tvix/store/src/blobservice/memory.rs
index a53f8991498b..244055258ef9 100644
--- a/tvix/store/src/blobservice/memory.rs
+++ b/tvix/store/src/blobservice/memory.rs
@@ -79,7 +79,7 @@ impl std::io::Write for MemoryBlobWriter {
             )),
             Some((ref mut buf, ref mut hasher)) => {
                 let bytes_written = buf.write(b)?;
-                hasher.write(&buf[..bytes_written])
+                hasher.write(&b[..bytes_written])
             }
         }
     }