6 const char *const SEGFAULT_COMMAND
= "segfault";
7 const char *const ABORT_COMMAND
= "abort";
10 int main(int argc
, char **argv
) {
12 std::cout
<< "expected at least one command provided on the command line"
16 // Process command line args.
17 for (int i
= 1; i
< argc
; ++i
) {
18 const char *const command
= argv
[i
];
19 if (std::strstr(command
, SEGFAULT_COMMAND
)) {
20 // Perform a null pointer access.
21 int *const null_int_ptr
= nullptr;
22 *null_int_ptr
= 0xDEAD;
23 } else if (std::strstr(command
, ABORT_COMMAND
)) {
26 std::cout
<< "Unsupported command: " << command
<< std::endl
;