summaryrefslogtreecommitdiff
path: root/arch/s390/boot/printk.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/boot/printk.c')
-rw-r--r--arch/s390/boot/printk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/s390/boot/printk.c b/arch/s390/boot/printk.c
index 8f3b2244ef1b..4bb6bc95704e 100644
--- a/arch/s390/boot/printk.c
+++ b/arch/s390/boot/printk.c
@@ -29,7 +29,8 @@ static void boot_rb_add(const char *str, size_t len)
/* store strings separated by '\0' */
if (len + 1 > avail)
boot_rb_off = 0;
- strcpy(boot_rb + boot_rb_off, str);
+ avail = sizeof(boot_rb) - boot_rb_off - 1;
+ strscpy(boot_rb + boot_rb_off, str, avail);
boot_rb_off += len + 1;
}
@@ -161,7 +162,7 @@ static noinline char *strsym(char *buf, void *ip)
strscpy(buf, p, MAX_SYMLEN);
/* reserve 15 bytes for offset/len in symbol+0x1234/0x1234 */
p = buf + strnlen(buf, MAX_SYMLEN - 15);
- strcpy(p, "+0x");
+ strscpy(p, "+0x", MAX_SYMLEN - (p - buf));
as_hex(p + 3, off, 0);
strcat(p, "/0x");
as_hex(p + strlen(p), len, 0);