fix: resolve use-afer-free in backup.zig
This worked fine on stage1, and works fine in debug in stage3. However, stage3 ReleaseSafe would panic due to what I assume must have been an undefined behaviour optimization. While I'm happy that I was quickly made aware of the issue thanks to the safety checks in ReleaseSafe I do wish that this issue showed itself in Debug, since I *am* using the GPA
This commit is contained in:
@@ -69,7 +69,7 @@ pub fn intToBytes(comptime T: type, value: anytype) [@sizeOf(T)]u8 {
|
||||
///
|
||||
/// This function returns a slice of everything just before the first
|
||||
/// `\0`
|
||||
pub fn asString(title: [12]u8) []const u8 {
|
||||
pub fn asStringSlice(title: *const [12]u8) []const u8 {
|
||||
var len = title.len;
|
||||
for (title) |char, i| {
|
||||
if (char == 0) {
|
||||
|
||||
Reference in New Issue
Block a user