summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arch/arm/linux/atag.hh5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/arch/arm/linux/atag.hh b/src/arch/arm/linux/atag.hh
index b7c37dffd..71271dac2 100644
--- a/src/arch/arm/linux/atag.hh
+++ b/src/arch/arm/linux/atag.hh
@@ -156,7 +156,10 @@ class AtagCmdline : public AtagHeader
delete[] storage;
storage = new uint32_t[size()];
-
+ // Initialize the last byte of memory here beacuse it might be slightly
+ // longer than needed and mis-speculation of the NULL in the O3 CPU can
+ // change stats ever so slightly when that happens.
+ storage[size() - 1] = 0;
strcpy((char*)&storage[2] , s.c_str());
}
AtagCmdline()