authorgravatar for bygreensky@gmail.comKamil T <bygreensky@gmail.com> 2024-09-18 09:41:46+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-20 21:41:12-08:00
logd50bae4da9739cd3385463203a2c461f75c8597e
treec8953c9c66605d4b1379f06e09cc3aa5a7f4dc22
parent0595feb34128db22fbebea843af929de3ede8190

Fix memcpy alias bug in std.compress.lzma


1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/compress/lzma.zig+1-1
...@@ -77,7 +77,7 @@ pub fn Decompress(comptime ReaderType: type) type {...@@ -77,7 +77,7 @@ pub fn Decompress(comptime ReaderType: type) type {
77 const input = self.to_read.items;77 const input = self.to_read.items;
78 const n = @min(input.len, output.len);78 const n = @min(input.len, output.len);
79 @memcpy(output[0..n], input[0..n]);79 @memcpy(output[0..n], input[0..n]);
80 @memcpy(input[0 .. input.len - n], input[n..]);80 std.mem.copyForwards(u8, input[0 .. input.len - n], input[n..]);
81 self.to_read.shrinkRetainingCapacity(input.len - n);81 self.to_read.shrinkRetainingCapacity(input.len - n);
82 return n;82 return n;
83 }83 }