From b6c5242365d6183a0a5172d7223255f0a3d17f8a Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Sun, 25 Sep 2016 22:36:26 +0200 Subject: [PATCH] UPSTREAM: intel/gma/vbt.c: pad the ID string with spaces. The VBT id string is 20 characters long. If the string is shorter than 20 it needs spaces at the end. This change is cosmetic as all strings were padded by hand. BUG=None BRANCH=None TEST=None Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/16739 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Nico Huber Change-Id: Id6439f1d3dbd09319ee99ce9d15dbc3bcead1f53 Reviewed-on: https://chromium-review.googlesource.com/390400 Commit-Ready: Furquan Shaikh Tested-by: Furquan Shaikh Reviewed-by: Aaron Durbin --- src/drivers/intel/gma/vbt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/drivers/intel/gma/vbt.c b/src/drivers/intel/gma/vbt.c index e768402b04..9ec09d313c 100644 --- a/src/drivers/intel/gma/vbt.c +++ b/src/drivers/intel/gma/vbt.c @@ -34,7 +34,9 @@ static size_t generate_vbt(const struct i915_gpu_controller_info *conf, memset (head, 0, sizeof (*head)); - memcpy (head->signature, idstr, 20); + memset(head->signature, ' ', sizeof(head->signature)); + memcpy(head->signature, idstr, MIN(strlen(idstr), + sizeof(head->signature))); head->version = 100; head->header_size = sizeof (*head); head->bdb_offset = sizeof (*head);