cybersecurity · intermediate · ~15 min
Detect path-traversal components.
Implement int has_dotdot(const char *path) returning 1 if path contains the ".." sequence (a path-traversal indicator), else 0.
#include <string.h>
int has_dotdot(const char *path) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.