summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-12-14 10:05:27 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2021-12-16 22:46:30 -0500
commit9020be114a47bf7ff33e179b3bb0016b91a098e6 (patch)
treed1312e9faaf539e5089ea9b5c0c6414cdd5fce6b /drivers/scsi/lpfc
parent2fe24343922e0428fb68674a4fae099171141bc7 (diff)
downloadlinux-9020be114a47bf7ff33e179b3bb0016b91a098e6.tar.gz
linux-9020be114a47bf7ff33e179b3bb0016b91a098e6.tar.bz2
linux-9020be114a47bf7ff33e179b3bb0016b91a098e6.zip
scsi: lpfc: Terminate string in lpfc_debugfs_nvmeio_trc_write()
The "mybuf" string comes from the user, so we need to ensure that it is NUL terminated. Link: https://lore.kernel.org/r/20211214070527.GA27934@kili Fixes: bd2cdd5e400f ("scsi: lpfc: NVME Initiator: Add debugfs support") Reviewed-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_debugfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
index bd6d459afce5..08b2e85dcd7d 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.c
+++ b/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -2954,8 +2954,8 @@ lpfc_debugfs_nvmeio_trc_write(struct file *file, const char __user *buf,
char mybuf[64];
char *pbuf;
- if (nbytes > 64)
- nbytes = 64;
+ if (nbytes > 63)
+ nbytes = 63;
memset(mybuf, 0, sizeof(mybuf));