summaryrefslogtreecommitdiff
path: root/util/nvramtool
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2014-12-01 22:09:33 +0100
committerPatrick Georgi <pgeorgi@google.com>2014-12-02 11:02:17 +0100
commit59ab4e99ee9553cc472970656ee85dc255f502b7 (patch)
treee85812b5cef897f81c19f75629cb740a8a641e9d /util/nvramtool
parent10b3994f1ae5551d7cc13afacd853a1bbc200f77 (diff)
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> Reviewed-on: http://review.coreboot.org/7621 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'util/nvramtool')
-rw-r--r--util/nvramtool/cmos_lowlevel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/nvramtool/cmos_lowlevel.c b/util/nvramtool/cmos_lowlevel.c
index c46e48062d..32f0e0a680 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));