]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
scsi: qedi: Fix a potential buffer overflow
authorBart Van Assche <bart.vanassche@wdc.com>
Thu, 26 Jul 2018 21:10:37 +0000 (14:10 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 31 Jul 2018 02:30:32 +0000 (22:30 -0400)
commit15d258674b5c91b9c1ae11264624d5c0d0675e8f
tree90714990e11e5dee7a12fd254ad01430649af2f2
parent5e53be8e476a3397ed5383c23376f299555a2b43
scsi: qedi: Fix a potential buffer overflow

Tell snprintf() to store at most 255 characters in the output buffer
instead of 256. This patch avoids that smatch reports the following
warning:

drivers/scsi/qedi/qedi_main.c:891: qedi_get_boot_tgt_info() error: snprintf() is printing too much 256 vs 255

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: <QLogic-Storage-Upstream@cavium.com>
Cc: <stable@vger.kernel.org>
Acked-by: Nilesh Javali <nilesh.javali@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qedi/qedi_main.c