I've been struggling an immense amount in identifying Vulnerabilities and demonstrating on steps to prove that it is a v

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

I've been struggling an immense amount in identifying Vulnerabilities and demonstrating on steps to prove that it is a v

Post by answerhappygod »

I've been struggling an immense amount in identifying
Vulnerabilities and demonstrating on steps to prove that it is a
vulnerability without using means of exploits.
Any help in directing me to what type of vulnerabilities can be
identified here and means of showing that it is a vulnerability
would be greatly appreciated!
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static char input[16];
char* openFile(char *filename, int select);
int readWord(char *argv);
int main (int argc, char **argv)
{
char *det="input1.txt";
char *output;
int select=1;
if (argc>1)
select=readWord(argv[1]);
output=openFile(det,select);
printf("%s\n",output);
}
int readWord(char *argv)
{
int word;
printf("Which number word do you want selected? ");
scanf("%d",&word);
printf("word is %d\n",word);
strcpy(input,argv);
return word;
}
char* openFile(char *filename, int select)
{
int x;
FILE *f0;
char *fileScan;
fileScan=malloc(16);
if ((f0=fopen(filename,"r"))==NULL)
{printf("Error\n");exit(0);}
for (x=0;x<(select+1);x++)
fscanf(f0,"%s",fileScan);
fclose(f0);
return fileScan;
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply