Question
getscore c code #include #include #include #include #include FILE *scorefile; int get_score(char *name, char *ssn, char *score); char* str_prefix(char *prefix, char *str); int main(int argc,
getscore c code
#include
while (fgets(line, 128, scorefile)!=NULL){ if ((match_point=str_prefix(matching_pattern, line))){ if (*match_point++==':'){ while (*match_point!=':'){ *score++=*match_point++; } *score=0; return 0; } } } return -1; } char* str_prefix(char *prefix, char *str){ while (*prefix && *str){ if (*prefix != *str) return NULL; prefix++; str++; } return *prefix==0?str:NULL; }
Please help me with this!
For the program getscore.c, identify two places where there is a security vulnerability. Demonstrate the existence of the vulnerability by providing the program with inputs that would crash the program. Show that the program will not crash with the same input after you fix the vulnerability. Include screenshots in your answers. Extra credit (5 pts) Try to find a third vulnerability in the codeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started