DF-1155 / fix.diff
diff --git a/sys/dev/disk/isp/isp_freebsd.c b/sys/dev/disk/isp/isp_freebsd.c --- a/sys/dev/disk/isp/isp_freebsd.c +++ b/sys/dev/disk/isp/isp_freebsd.c @@ -1923,8 +1923,8 @@ } atiop->init_id = GET_IID_VAL(aep->at_iid); - atiop->cdb_len = aep->at_cdblen; - ISP_MEMCPY(atiop->cdb_io.cdb_bytes, aep->at_cdb, aep->at_cdblen); + atiop->cdb_len = min(aep->at_cdblen, sizeof(atiop->cdb_io.cdb_bytes)); + ISP_MEMCPY(atiop->cdb_io.cdb_bytes, aep->at_cdb, atiop->cdb_len); atiop->ccb_h.status = CAM_CDB_RECVD; /* * Construct a tag 'id' based upon tag value (which may be 0..255) |