diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2023-09-11 13:03:00 +0200 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2023-09-19 13:26:56 +0200 |
commit | aa36d433b79657c1fed31ff5ae2bbd6f7bc123aa (patch) | |
tree | 658ca183390e94c088c6a4f06bde51189c9648ec /arch/s390/kernel/setup.c | |
parent | 3570ee046c46b5dc3d077e3e60616b141a221027 (diff) |
s390/setup: use strlcat() instead of strcat()
Use strlcat() instead of strcat() in order to get rid of this W=1
warning:
In function ‘strlcat’,
inlined from ‘strcat’ at ./include/linux/fortify-string.h:432:6,
inlined from ‘setup_zfcpdump’ at arch/s390/kernel/setup.c:308:2,
inlined from ‘setup_arch’ at arch/s390/kernel/setup.c:1002:2:
./include/linux/fortify-string.h:406:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
406 | p[actual] = '\0';
| ~~~~~~~~~~^~~~~~
As stated in fortify-string.h strcat() should not be used, since
FORTIFY_SOURCE cannot figure out the size of the destination buffer.
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/setup.c')
-rw-r--r-- | arch/s390/kernel/setup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index deb97723c890..ef158bd0ea7b 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c @@ -305,7 +305,7 @@ static void __init setup_zfcpdump(void) return; if (oldmem_data.start) return; - strcat(boot_command_line, " cio_ignore=all,!ipldev,!condev"); + strlcat(boot_command_line, " cio_ignore=all,!ipldev,!condev", COMMAND_LINE_SIZE); console_loglevel = 2; } #else |