mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-22 07:06:22 +00:00
qla2x00t: Fix a potential buffer overflow
Detected by Coverity. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This commit is contained in:
+3
-2
@@ -2187,8 +2187,9 @@ qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len,
|
||||
if (use_tbl &&
|
||||
ha->pdev->subsystem_vendor == PCI_VENDOR_ID_QLOGIC &&
|
||||
index < QLA_MODEL_NAMES) {
|
||||
strcpy(ha->model_number,
|
||||
qla2x00_model_name[index * 2]);
|
||||
strlcpy(ha->model_number,
|
||||
qla2x00_model_name[index * 2],
|
||||
sizeof(ha->model_number));
|
||||
strncpy(ha->model_desc,
|
||||
qla2x00_model_name[index * 2 + 1],
|
||||
sizeof(ha->model_desc) - 1);
|
||||
|
||||
Reference in New Issue
Block a user