diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-07-14 14:07:11 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-07-29 09:00:03 -0600 |
commit | 33027c2bb53e33bdb7749d357da199cb54e8fb6f (patch) | |
tree | 5b2b27e132d350282d6241efe07d0d1f8f18faa1 /drivers/scsi/scsi_transport_iscsi.c | |
parent | 35fe6d763229e8fc0eb5f9b93a401673cfcb5e1e (diff) |
block: DAC960: shut up format-overflow warning
gcc-7 points out that a large controller number would overflow the
string length for the procfs name and the firmware version string:
drivers/block/DAC960.c: In function 'DAC960_Probe':
drivers/block/DAC960.c:6591:38: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
drivers/block/DAC960.c: In function 'DAC960_V1_ReadControllerConfiguration':
drivers/block/DAC960.c:1681:40: error: '%02d' directive writing between 2 and 3 bytes into a region of size between 2 and 5 [-Werror=format-overflow=]
drivers/block/DAC960.c:1681:40: note: directive argument in the range [0, 255]
drivers/block/DAC960.c:1681:3: note: 'sprintf' output between 10 and 14 bytes into a destination of size 12
Both of these seem appropriately sized, and using snprintf()
instead of sprintf() improves this by ensuring that even
incorrect data won't cause undefined behavior here.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/scsi/scsi_transport_iscsi.c')
0 files changed, 0 insertions, 0 deletions