Is there a tool or swftare that I can use it to detect buffer overflow bugs and
ID: 3740424 • Letter: I
Question
Is there a tool or swftare that I can use it to detect buffer overflow bugs and analyze vulnerabilities in my code??
Because I could not find user answer my questions as seperate with more details!
int main(int argc, char *argv[]) {
int i;
char buf[100];
char firstname[30]; char lastname[30]; char jobtitle[80]; char email[80]; char phone[15]; char company[80];
char buffer[500]; char* copyright; char *cstr; size_t needed; int n;
// We are passing command line argument to buf if there is one
if(argc>=2) {
strncpy(buf, argv[1], 100);
}
copyright = getenv("COPYRIGHT");
printf("Welcome ");
if (copyright!=NULL) {
needed = snprintf(NULL, 0, "echo © %s", copyright); cstr = malloc(needed+1);?snprintf(cstr, needed+1, "echo © %s", copyright); system(cstr);
free(cstr);
} else {
system("echo © 2018"); }
printf("Please fill out the registration form by answering questions below "); printf("First name:");?gets(firstname);
printf("Last name:"); gets(lastname);
printf("Job title:"); gets(jobtitle);
printf("Email:"); gets(email);
printf("Phone:"); gets(phone);
printf("Company:"); gets(company);
printf(" Your Registration Information is: "); printf("First name:%s ",firstname); printf("Last name:%s ",lastname);?printf("Job title:%s ",jobtitle); printf("Email:%s ",email); printf("Phone:%s ",phone);
printf("Company:%s ",company);
n=sprintf (buffer, "echo %s firstname,lastname,jobtitle,email,phone,company);
i = system(buffer);
return 0;
}
Explanation / Answer
No there is no tool which can be used to detect buffer overflow or underflow.
If you want me to answer your questions specifically, please update the question with all the issues/errors that you are getting while compiling your code.
Once you provide all the issues, I will provide you the soutions to all your issues.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.