tcpcheck_spop_expect_hello() stores the SPOA agent-supplied status-code
varint directly into check->code (signed short) without range validation.
The code is later used as an index into spop_err_reasons[100]. Let's
just replace invalid status codes with SPOP_ERR_UNKNOWN to avoid any
problem.
The SPOP tcp-check was introduced in 3.1 so this fix must be backported
to 3.2.
goto invalid_frame;
if (decode_varint(&ptr, end, &sz) == -1)
goto invalid_frame;
+ if (sz >= SPOP_ERR_ENTRIES)
+ sz = SPOP_ERR_UNKNOWN;
check->code = sz;
}