unsigned char *stole;
The above statement declares stoleas a pointer to unsigned charand contains the value of the garbage, pointing to a random memory location.
scanf("%s", stole);
, stole, ( , ). , scanf , seg-fault.
stole
unsigned char stole[MAX_SIZE];
unsigned char *stole = malloc((MAX_SIZE+1) * sizeof(char));