aboutsummaryrefslogtreecommitdiff
path: root/src/monkey/bug_null_pointer_exception.c
blob: 4accd65af60e9b169359fe9447a5539be010958d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <string.h>


struct CrashStruct {
	const char *crashValue;
};

void crashFunction() 
{
	struct CrashStruct *crashStruct;
	crashStruct = NULL;
	printf("Now the program will crash!\n");
	crashStruct->crashValue = "hello!";
}

int main(int argc, char *argv[]) 
{
	crashFunction();
	return 0;
}