summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2021-03-10 20:33:01 +0100
committerAndreas Kling <kling@serenityos.org>2021-03-11 12:32:53 +0100
commitf38a6b18b55aad9ae6aee0aa2f8490079c79e73e (patch)
tree6501aa9a4a0dbb032e9a1dd2a644a1989c56627e
parent798dea7a4964b08b9aeec2e68183819262b40daf (diff)
downloadserenity-f38a6b18b55aad9ae6aee0aa2f8490079c79e73e.zip
crash: Fix more typos in check logic
These caused no test to run for '-f' and mmap to fail, respectively.
-rw-r--r--Userland/Utilities/crash.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Utilities/crash.cpp b/Userland/Utilities/crash.cpp
index cb9cad0cbf..1aacf79aa3 100644
--- a/Userland/Utilities/crash.cpp
+++ b/Userland/Utilities/crash.cpp
@@ -200,7 +200,7 @@ int main(int argc, char** argv)
}).run(run_type);
}
- if (do_read_from_uninitialized_malloc_memory || do_all_crash_types) {
+ if (do_read_from_freed_memory || do_all_crash_types) {
Crash("Read from freed memory", []() {
auto* uninitialized_memory = (volatile u32**)malloc(1024);
if (!uninitialized_memory)
@@ -237,7 +237,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);
+ auto* ptr = (u8*)mmap(nullptr, 4096, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, 0, 0);
if (ptr == MAP_FAILED)
return Crash::Failure::UnexpectedError;