cybersecurity · intermediate · ~15 min · safe pentest lab
Tally several dangerous patterns.
Implement int count_unsafe(const char *code) returning how many occurrences of the unsafe calls "strcpy(", "strcat(", "sprintf(", and "gets(" appear (summed).
#include <string.h>
int count_unsafe(const char *code) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.