In usr.bin/tar/tree.c, if you really want to poke to NULL, you must use

volatile, otherwise the indirection will not be emitted.

MFC after:	1 week
This commit is contained in:
dim 2011-12-17 01:36:50 +00:00
parent 7654ad9896
commit 8c3e7b0062

View File

@ -315,7 +315,7 @@ tree_next(struct tree *t)
const char *msg = "Unable to continue traversing"
" directory hierarchy after a fatal error.";
write(2, msg, strlen(msg));
*(int *)0 = 1; /* Deliberate SEGV; NULL pointer dereference. */
*(volatile int *)0 = 1; /* Deliberate SEGV; NULL pointer dereference. */
exit(1); /* In case the SEGV didn't work. */
}