Question: will need to enter in the right values to trick the pointer arithmetic logic and get to the call _ me ( ) function. #include

will need to enter in the right values to trick the pointer arithmetic logic and get to the call_me() function.
#include
#include
#include
#include "../../shared/kernels_lib.c"
typedef struct node_t {
int x;
char y;
float z;
} weird_node;
void unsafe(){
int characters_read;
int some_other_value =0xFFFF;
int* protector =(int *)malloc(sizeof(weird_node)*33);
char buffer[24];
printf("Give me some strings (Mind your values!):
");
read(0, buffer, 1000);
characters_read = strlen(buffer);
if (*(&protector + some_other_value)==0xbadf00d){
if (characters_read >24){
printf("
\ttoo many characters read!
");
exit(-1);
} else {
call_me();
}
}
}
int main(int argc, char* argv[]){
unsafe();
return 0;
}
what is the input that will let me call call_me function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!