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 code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
