# M0120 possible run-time panic (/docs/diagnostics/codes/m0120)

A manifest finding is a panic that a guard in the code fails to exclude: the code tests the quantity, but with a weaker bound than the operation needs, so the input the message names passes the guard and panics. A latent finding is a panic for some inputs of the function, a precondition its callers must meet; latent findings are notes and are shown with -latent. The verify object in JSON has the obligation, the condition, the status and the assumptions the result depends on.

## The mistake and the fix [#the-mistake-and-the-fix]

<div className="code-pair">

```go title="The mistake"
func Header(b []byte) (byte, uint16) {
	if len(b) < 2 {
		return 0, 0
	}
	return b[0], uint16(b[1])<<8 | uint16(b[2]) // len(b) == 2 panics
}
```

```go title="Fixed"
func Header(b []byte) (byte, uint16) {
	if len(b) < 3 { // [!code highlight]
		return 0, 0
	}
	return b[0], uint16(b[1])<<8 | uint16(b[2]) // [!code highlight]
}
```

</div>

## The fix [#the-fix]

Tighten the guard to the bound the operation needs, or check the input before the operation. A fix that returns early silences the panic but can change behavior: the program's tests decide.

See also [all error codes](/docs/diagnostics/codes) and [marmot explain](/docs/commands/explain).