Commit 7bd1d615 authored by Dominique Martinet's avatar Dominique Martinet Committed by Martin K. Petersen

scsi: mptctl: change strncpy+truncation to strlcpy

Generated by scripts/coccinelle/misc/strncpy_truncation.cocci
Signed-off-by: default avatarDominique Martinet <asmadeus@codewreck.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f4e34f2a
...@@ -2514,8 +2514,8 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size) ...@@ -2514,8 +2514,8 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
if (mpt_config(ioc, &cfg) == 0) { if (mpt_config(ioc, &cfg) == 0) {
ManufacturingPage0_t *pdata = (ManufacturingPage0_t *) pbuf; ManufacturingPage0_t *pdata = (ManufacturingPage0_t *) pbuf;
if (strlen(pdata->BoardTracerNumber) > 1) { if (strlen(pdata->BoardTracerNumber) > 1) {
strncpy(karg.serial_number, pdata->BoardTracerNumber, 24); strlcpy(karg.serial_number,
karg.serial_number[24-1]='\0'; pdata->BoardTracerNumber, 24);
} }
} }
pci_free_consistent(ioc->pcidev, hdr.PageLength * 4, pbuf, buf_dma); pci_free_consistent(ioc->pcidev, hdr.PageLength * 4, pbuf, buf_dma);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment