mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 18:13:04 +00:00
1b61680cfe
When -Wstringop-truncation is enabled, gcc finds a function that
always does a short copy:
In function 'inquiry',
inlined from 'rtsx_scsi_handler' at drivers/staging/rts5208/rtsx_scsi.c:3210:12:
drivers/staging/rts5208/rtsx_scsi.c:526:17: error: 'strncpy' output truncated copying between 1 and 28 bytes from a string of length 28 [-Werror=stringop-truncation]
526 | strncpy(buf + 8, inquiry_string, sendbytes - 8);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The code originally had a memcpy() that would overread the source string,
and commit
|
||
---|---|---|
.. | ||
general.c | ||
general.h | ||
Kconfig | ||
Makefile | ||
ms.c | ||
ms.h | ||
rtsx_card.c | ||
rtsx_card.h | ||
rtsx_chip.c | ||
rtsx_chip.h | ||
rtsx_scsi.c | ||
rtsx_scsi.h | ||
rtsx_sys.h | ||
rtsx_transport.c | ||
rtsx_transport.h | ||
rtsx.c | ||
rtsx.h | ||
sd.c | ||
sd.h | ||
spi.c | ||
spi.h | ||
TODO | ||
xd.c | ||
xd.h |