mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:57:45 +00:00
LibC: Ensure that struct group::gr_mem
pointers are aligned
Otherwise, we get a UBSan crash in SystemServer before we could even start running tests on AArch64.
This commit is contained in:
parent
7987bf5b92
commit
2e0e80db69
1 changed files with 1 additions and 1 deletions
|
@ -113,7 +113,7 @@ static bool parse_grpdb_entry(char* buffer, size_t buffer_size, struct group& gr
|
|||
|
||||
// Must have room at the end of the buffer for the new table.
|
||||
// Remaining space is one byte past null terminator generated by original line.
|
||||
size_t bytes_used = line_length + 1;
|
||||
size_t bytes_used = round_up_to_power_of_two(line_length + 1, alignof(char*));
|
||||
size_t ptrs_size = sizeof(char const*) * members_ptrs.size();
|
||||
|
||||
if (bytes_used + ptrs_size < buffer_size) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue