Skip to content

Commit 9020be1

Browse files
Dan Carpentermartinkpetersen
authored andcommitted
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: bd2cdd5 ("scsi: lpfc: NVME Initiator: Add debugfs support") Reviewed-by: James Smart <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 2fe2434 commit 9020be1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/scsi/lpfc/lpfc_debugfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2954,8 +2954,8 @@ lpfc_debugfs_nvmeio_trc_write(struct file *file, const char __user *buf,
29542954
char mybuf[64];
29552955
char *pbuf;
29562956

2957-
if (nbytes > 64)
2958-
nbytes = 64;
2957+
if (nbytes > 63)
2958+
nbytes = 63;
29592959

29602960
memset(mybuf, 0, sizeof(mybuf));
29612961

0 commit comments

Comments
 (0)