mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-09 04:37:52 +03:00
crash: Fix typo in check logic
The remainder of the code assumes that the mmap was successful, so the 'unexpected error' case is that we see MAP_FAILED.
This commit is contained in:
parent
bceb98e2df
commit
798dea7a49
Notes:
sideshowbarker
2024-07-18 21:32:06 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/798dea7a496 Pull-request: https://github.com/SerenityOS/serenity/pull/5720
@ -238,7 +238,7 @@ int main(int argc, char** argv)
|
||||
if (do_write_to_read_only_memory || do_all_crash_types) {
|
||||
Crash("Write to read only memory", []() {
|
||||
auto* ptr = (u8*)mmap(nullptr, 4096, PROT_READ | PROT_WRITE, MAP_ANON, 0, 0);
|
||||
if (ptr != MAP_FAILED)
|
||||
if (ptr == MAP_FAILED)
|
||||
return Crash::Failure::UnexpectedError;
|
||||
|
||||
*ptr = 'x'; // This should work fine.
|
||||
|
Loading…
Reference in New Issue
Block a user