Question: 1 . Analyze Security Problems in this Programs . 2 . Convert this vulnerable code into a secure program. 3 . Perform White box testing

1. Analyze Security Problems in this Programs.
2. Convert this vulnerable code into a secure program.
3. Perform White box testing by path coverage for the given program.
#include
#include
#define S 100
#define N 1000
int main(int argc, char *argv[]){
char out[S];
char buf[N];
char msg[]= "Welcome to the argument echoing program
";
int len =0;
buf[0]='\0';
printf(msg);
while (argc){
sprintf(out, "argument %d is %s
", argc-1, argv[argc-1]);
argc--;
strncat(buf,out,sizeof(buf)-len-1);
len = strlen(buf);
}
printf("%s",buf);
return 0;
}

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!