From 8c3e7b006248d436f4862b181ab9fd7a44c7b3a6 Mon Sep 17 00:00:00 2001 From: dim Date: Sat, 17 Dec 2011 01:36:50 +0000 Subject: [PATCH] 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 --- usr.bin/tar/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/tar/tree.c b/usr.bin/tar/tree.c index 58e9febd3d8e..27cbd7175c5b 100644 --- a/usr.bin/tar/tree.c +++ b/usr.bin/tar/tree.c @@ -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. */ }