Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7621
-gerrit
commit 7c1f2a325cda74e0c09bca5c5dec1c64fe526afe
Author: Patrick Georgi <pgeorgi(a)google.com>
Date: Mon Dec 1 22:09:33 2014 +0100
nvramtool: make sure that strings are 0-terminated
The call site expects them to be.
Change-Id: Ic05fc5831f5743d94fe617dfb3b9e329f01866d1
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
util/nvramtool/cmos_lowlevel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/nvramtool/cmos_lowlevel.c b/util/nvramtool/cmos_lowlevel.c
index 618e8d2..87d0acc 100644
--- a/util/nvramtool/cmos_lowlevel.c
+++ b/util/nvramtool/cmos_lowlevel.c
@@ -125,7 +125,7 @@ unsigned long long cmos_read(const cmos_entry_t * e)
result = 0;
if (e->config == CMOS_ENTRY_STRING) {
- int strsz = (length + 7) / 8;
+ int strsz = (length + 7) / 8 + 1;
char *newstring = alloca(strsz);
unsigned usize = (8 * sizeof(unsigned long long));