From b9c41813d29be3a520d196ce3abfb533fb5c0dbb Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 Sep 2010 08:58:19 -0400 Subject: [PATCH] libarchive: Fix purposeful crash Dereferencing a 0-pointer is undefined behavior, not a deterministic crash. Use a 1-pointer instead. This also avoids a warning by Clang about the undefined behavior. --- Utilities/cmlibarchive/libarchive/archive_check_magic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/cmlibarchive/libarchive/archive_check_magic.c b/Utilities/cmlibarchive/libarchive/archive_check_magic.c index a9177d778..e9dbe5148 100644 --- a/Utilities/cmlibarchive/libarchive/archive_check_magic.c +++ b/Utilities/cmlibarchive/libarchive/archive_check_magic.c @@ -69,7 +69,7 @@ diediedie(void) /* Cause a breakpoint exception */ DebugBreak(); #endif - *(char *)0 = 1; /* Deliberately segfault and force a coredump. */ + *(char *)1 = 1; /* Deliberately segfault and force a coredump. */ _exit(1); /* If that didn't work, just exit with an error. */ }