Skip to content

Commit 1468d6b

Browse files
Vasily Gorbikhcahca
authored andcommitted
s390/boot: Replace strncpy() with strscpy()
Replace the last 2 usages of strncpy() in s390 code with strscpy(). Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent f271df9 commit 1468d6b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

arch/s390/boot/ipl_parm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ void parse_boot_command_line(void)
309309
if (!strcmp(param, "bootdebug")) {
310310
bootdebug = true;
311311
if (val)
312-
strncpy(bootdebug_filter, val, sizeof(bootdebug_filter) - 1);
312+
strscpy(bootdebug_filter, val);
313313
}
314314
if (!strcmp(param, "quiet"))
315315
boot_console_loglevel = CONSOLE_LOGLEVEL_QUIET;

arch/s390/boot/printk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static noinline char *strsym(char *buf, void *ip)
158158

159159
p = findsym((unsigned long)ip, &off, &len);
160160
if (p) {
161-
strncpy(buf, p, MAX_SYMLEN);
161+
strscpy(buf, p, MAX_SYMLEN);
162162
/* reserve 15 bytes for offset/len in symbol+0x1234/0x1234 */
163163
p = buf + strnlen(buf, MAX_SYMLEN - 15);
164164
strcpy(p, "+0x");

0 commit comments

Comments
 (0)