Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7621
-gerrit
commit 4c92e32519e979b7ed8a407cc311a7985480c4f0 Author: Patrick Georgi pgeorgi@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@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 c46e480..32f0e0a 100644 --- a/util/nvramtool/cmos_lowlevel.c +++ b/util/nvramtool/cmos_lowlevel.c @@ -128,7 +128,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 = malloc(strsz); unsigned usize = (8 * sizeof(unsigned long long));