qla2x00t: Fix a potential buffer overflow

Detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6391 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2015-06-17 00:36:22 +00:00
parent 2a6a25ba45
commit 7b8ad56790
+3 -2
View File
@@ -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);