Commit aa5865b9be

LemonBoy <thatlemon@gmail.com>
2020-03-31 10:37:56
std: Fix oob slicing operator
1 parent 855edd2
Changed files (1)
lib
std
lib/std/fs.zig
@@ -1522,7 +1522,7 @@ pub fn openSelfExe() OpenSelfExeError!File {
     var buf: [MAX_PATH_BYTES]u8 = undefined;
     const self_exe_path = try selfExePath(&buf);
     buf[self_exe_path.len] = 0;
-    return openFileAbsoluteZ(self_exe_path[0..self_exe_path.len :0].ptr, .{});
+    return openFileAbsoluteZ(buf[0..self_exe_path.len :0].ptr, .{});
 }
 
 test "openSelfExe" {