From 4e2570baafb587c679ee0fc5e113ddeb36522a5d Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Mon, 26 Feb 2024 17:04:28 +0100 Subject: http: fix fetching a github release * Support different keep alive defaults with different http versions. * Fix incorrect usage of `copyBackwards`, which copies in a backwards direction allowing data to be moved forward in a buffer, not backwards in a buffer. --- lib/std/Uri.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/std/Uri.zig') diff --git a/lib/std/Uri.zig b/lib/std/Uri.zig index 0903c129c4..cbd3d42741 100644 --- a/lib/std/Uri.zig +++ b/lib/std/Uri.zig @@ -367,7 +367,7 @@ pub const ResolveInplaceError = ParseError || error{OutOfMemory}; /// If a merge needs to take place, the newly constructed path will be stored /// in `aux_buf` just after the copied `new`. pub fn resolve_inplace(base: Uri, new: []const u8, aux_buf: []u8) ResolveInplaceError!Uri { - std.mem.copyBackwards(u8, aux_buf, new); + std.mem.copyForwards(u8, aux_buf, new); // At this point, new is an invalid pointer. const new_mut = aux_buf[0..new.len]; -- cgit v1.2.3