cybersecurity · beginner · ~15 min · safe pentest lab

Is the canary intact?

Model the canary integrity check.

Challenge

Implement int canary_intact(unsigned long stored, unsigned long current) returning 1 if the two values are equal (no overflow corrupted it), else 0.

Starter code

int canary_intact(unsigned long stored, unsigned long current) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.