currently code as below:
static int mctp_ctrl_validate_response(uint8_t *buf, size_t rsp_size,
size_t exp_size, const char *peer,
uint8_t iid, uint8_t cmd)
{
struct mctp_ctrl_resp *rsp;
**if (exp_size <= sizeof(*rsp))** { //????????????????????
warnx("invalid expected response size!");
return -EINVAL;
}
}
It should be *if (exp_size < sizeof(rsp)) more reasonable.