mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 08:33:06 +00:00
Do not assume that FILE_BOTH_DIR_INFORMATION is correctly aligned
This commit is contained in:
parent
dc72f17d80
commit
a58ecf7b09
@ -749,7 +749,9 @@ pub const IterableDir = struct {
|
||||
}
|
||||
}
|
||||
|
||||
const dir_info: *w.FILE_BOTH_DIR_INFORMATION = @ptrCast(@alignCast(&self.buf[self.index]));
|
||||
// While the official api docs guarantee FILE_BOTH_DIR_INFORMATION to be aligned properly
|
||||
// this may not always be the case (e.g. due to faulty VM/Sandboxing tools)
|
||||
const dir_info: *align(2) w.FILE_BOTH_DIR_INFORMATION = @ptrCast(@alignCast(&self.buf[self.index]));
|
||||
if (dir_info.NextEntryOffset != 0) {
|
||||
self.index += dir_info.NextEntryOffset;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user