--- a/sys/dev/disk/mpt/mpt.c +++ b/sys/dev/disk/mpt/mpt.c @@ -1473,6 +1473,8 @@ /* Get rest of the reply; but don't overflow the provided buffer */ left = (hdr->MsgLength << 1) - 2; + if (left < 0) + left = 0; reply_left = reply_len - 2; while (left--) { u_int16_t datum;