]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scsi: fnic: fix format string overflow warning
authorArnd Bergmann <arnd@arndb.de>
Fri, 14 Jul 2017 12:06:58 +0000 (14:06 +0200)
committerJack Vogel <jack.vogel@oracle.com>
Wed, 7 Mar 2018 04:10:19 +0000 (20:10 -0800)
commite27b027c389ed2288f199b6686ba678fda988bfb
tree207f82d4fc4a1407e6eb5c0b628d3b71d6a5b6a8
parent966d5e45850a3599ca6ee2f35ff107e546a73b49
scsi: fnic: fix format string overflow warning

The MSI interrupt name can require 11 bytes in addition to the device name,
for a total of 23 bytes:

drivers/scsi/fnic/fnic_isr.c: In function 'fnic_request_intr':
drivers/scsi/fnic/fnic_isr.c:192:4: error: '-fcs-rq' directive writing 7 bytes into a region of size between 5 and 16 [-Werror=format-overflow=]
    "%.11s-fcs-rq", fnic->name);
drivers/scsi/fnic/fnic_isr.c:206:3: note: 'sprintf' output between 12 and 23 bytes into a destination of size 16
   sprintf(fnic->msix[FNIC_MSIX_ERR_NOTIFY].devname,
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    "%.11s-err-notify", fnic->name);

This extends the buffer to fit any possible value.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 514e59c1195f2634dab025d952242f5e69e052c7)

Orabug: 27587343
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/fnic/fnic.h