Skip to content

Commit

Permalink
Fix UBSAN reported access to kernel_dirent withing misaligned address
Browse files Browse the repository at this point in the history
This is can be an issue on ARM, it can cause a hang of
CrashReportTest.MiniDump test on macOS.
  • Loading branch information
sergio-nsk committed Aug 6, 2024
1 parent ff38335 commit 381ed41
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/client/linux/minidump_writer/directory_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ class DirectoryReader {

private:
const int fd_;
bool hit_eof_;
unsigned buf_used_;
uint8_t buf_[sizeof(struct kernel_dirent) + NAME_MAX + 1];
alignas(struct kernel_dirent)
uint8_t buf_[sizeof(struct kernel_dirent) + NAME_MAX + 1];
bool hit_eof_;
};

} // namespace google_breakpad
Expand Down

0 comments on commit 381ed41

Please sign in to comment.