Hello Jacob Garber, Nico Huber, Patrick Georgi,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/34212
to review the following change.
Change subject: console: Fix array out-of-bounds access with printk("%#x") ......................................................................
console: Fix array out-of-bounds access with printk("%#x")
CB:34028 introduced an array out-of-bounds access in formatting code when using the "%#x" format qualifier. This patch fixes the issue.
Found by Coverity.
Change-Id: Ibf3676b8e3e6c69bd7a13562c2422c5c19d161d9 Signed-off-by: Julius Werner jwerner@chromium.org --- M src/console/vtxprintf.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/34212/1
diff --git a/src/console/vtxprintf.c b/src/console/vtxprintf.c index b50f398..470a0d9 100644 --- a/src/console/vtxprintf.c +++ b/src/console/vtxprintf.c @@ -107,7 +107,7 @@ call_tx('0'), count++; else if (base == 16) { call_tx('0'), count++; - call_tx(digits[33]), count++; + call_tx(type & LARGE ? 'X' : 'x'), count++; } } if (!(type & LEFT)) {