cybersecurity · intermediate · ~15 min · safe pentest lab

Is it a terminator canary?

Recognise the terminator-canary design.

Challenge

A terminator canary contains a NUL byte to stop string-based overflows. Implement int is_terminator_canary(unsigned long c) returning 1 if the LOW byte of c is 0, else 0.

Starter code

int is_terminator_canary(unsigned long c) {
    /* TODO */
    return 0;
}

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