cybersecurity · beginner · ~15 min · safe pentest lab
Honour the stop conditions in the RoE.
Apply a rules-of-engagement stop condition: halt and report immediately only when a critical finding occurred AND the RoE says to stop on critical findings.
Implement int must_stop(int found_critical, int roe_stop_on_critical) that returns 1 when both flags are true, and 0 otherwise.
found_critical: 1 if a critical finding occurred.roe_stop_on_critical: 1 if the rules of engagement require stopping on critical findings.Returns 1 if you must stop (both conditions hold), 0 otherwise.
must_stop(1, 1) -> 1 (critical found and RoE says stop)
must_stop(1, 0) -> 0 (RoE does not require stopping)
must_stop(0, 1) -> 0 (no critical finding)
Two flags: found_critical and roe_stop_on_critical (each 0 or 1).
1 if both flags are true; otherwise 0.
Logical AND of the two conditions.
int must_stop(int found_critical, int roe_stop_on_critical) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.