diff options
author | Arnd Bergmann | 2017-07-14 14:06:57 +0200 |
---|---|---|
committer | Martin K. Petersen | 2017-08-07 14:04:01 -0400 |
commit | 0606ffe26d6d7478fb5957cbc8b9cbbf14a7c68c (patch) | |
tree | 742e7ac0dc13b220743d21e3d7fb4dc4a7a08bad /net/sysctl_net.c | |
parent | bbfd8e8b241bdb4f4f53df1ba36d839441e5fd89 (diff) |
scsi: gdth: avoid buffer overflow warning
gcc notices that we would overflow the buffer for the
inquiry of the product name if we have too many adapters:
drivers/scsi/gdth.c: In function 'gdth_next':
drivers/scsi/gdth.c:2357:29: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
sprintf(inq.product,"Host Drive #%02d",t);
^~~~~~~~~~~~~~~~~~~
drivers/scsi/gdth.c:2357:9: note: 'sprintf' output between 16 and 17 bytes into a destination of size 16
sprintf(inq.product,"Host Drive #%02d",t);
This won't happen in practice, so just use snprintf to
truncate the string.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'net/sysctl_net.c')
0 files changed, 0 insertions, 0 deletions