commit 0fa89dc51d6bb92f36ceb1399e07aa6f7c1dbd2b (tree)
parent f13c67bcfed1c509abd13e83ae36479b793583d2
Author: LeRoyce Pearson <leroycepearson@geemili.xyz>
Date: Thu, 30 Apr 2020 17:04:13 -0600
Fix read from null pointer in CacheHash.hit
It occured when the manifest file was manually edited to include an extra
file. Now it will simply copy the file name in the manifest file
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/std/cache_hash.zig b/lib/std/cache_hash.zig
@@ -186,6 +186,10 @@ pub const CacheHash = struct {
return error.InvalidFormat;
}
+ if (cache_hash_file.path == null) {
+ cache_hash_file.path = try mem.dupe(self.alloc, u8, file_path);
+ }
+
const this_file = fs.cwd().openFile(cache_hash_file.path.?, .{ .read = true }) catch {
return error.CacheUnavailable;
};