mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
LibC: Use uintptr_t for __stack_chk_guard
We used size_t, which is a type that is guarenteed to be large enough to hold an array index, but uintptr_t is designed to be used to hold pointer values, which is the case of stack guards.
This commit is contained in:
parent
675e5bfdce
commit
89b23c473a
Notes:
sideshowbarker
2024-07-19 17:01:48 +09:00
Author: https://github.com/meme 🔰
Commit: 89b23c473a
Pull-request: https://github.com/SerenityOS/serenity/pull/16230
6 changed files with 11 additions and 11 deletions
|
@ -258,7 +258,7 @@ static void initialize_libc(DynamicObject& libc)
|
|||
// This is not done in __libc_init, as we definitely have to return from that, and it might affect Loader as well.
|
||||
res = libc.lookup_symbol("__stack_chk_guard"sv);
|
||||
VERIFY(res.has_value());
|
||||
arc4random_buf(res.value().address.as_ptr(), sizeof(size_t));
|
||||
arc4random_buf(res.value().address.as_ptr(), sizeof(uintptr_t));
|
||||
|
||||
res = libc.lookup_symbol("__environ_is_malloced"sv);
|
||||
VERIFY(res.has_value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue