From 5d2d317e34ea4bcee29aa13ce78e44b46d3a4872 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Wed, 19 Aug 2015 23:17:58 +0200 Subject: [PATCH] add one byte to the buffer of the kernel messages - guarantees that at least one byte contains the end of string character --- hermit/libkern/stdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hermit/libkern/stdio.c b/hermit/libkern/stdio.c index dd5c0b31a..9cdf7defb 100644 --- a/hermit/libkern/stdio.c +++ b/hermit/libkern/stdio.c @@ -43,7 +43,7 @@ static atomic_int32_t kmsg_counter = ATOMIC_INIT(-1); /* Workaround for a compiler bug. gcc 5.1 seems to ignore this array, if we defined it as as static array. At least it is as static array not part of the binary. => no valid kernel messages */ -/* static */ unsigned char kmessages[KMSG_SIZE] __attribute__ ((section(".kmsg"))) = {[0 ... KMSG_SIZE-1] = 0x00}; +/* static */ unsigned char kmessages[KMSG_SIZE+1] __attribute__ ((section(".kmsg"))) = {[0 ... KMSG_SIZE-1] = 0x00}; int koutput_init(void) {