cybersecurity · beginner · ~15 min · safe pentest lab

Should you stop?

Honour the stop conditions in the RoE.

Challenge

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.

Task

Implement int must_stop(int found_critical, int roe_stop_on_critical) that returns 1 when both flags are true, and 0 otherwise.

Input

  • found_critical: 1 if a critical finding occurred.
  • roe_stop_on_critical: 1 if the rules of engagement require stopping on critical findings.

Output

Returns 1 if you must stop (both conditions hold), 0 otherwise.

Example

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)

Edge cases

  • Both inputs must be true to return 1.

Input format

Two flags: found_critical and roe_stop_on_critical (each 0 or 1).

Output format

1 if both flags are true; otherwise 0.

Constraints

Logical AND of the two conditions.

Starter code

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.