[coreboot-gerrit] Change in ...coreboot[master]: romcc: Increase buffer size to fit max string size

Martin Roth (Code Review) gerrit at coreboot.org
Tue Nov 27 02:51:29 CET 2018


Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/29850


Change subject: romcc: Increase buffer size to fit max string size
......................................................................

romcc: Increase buffer size to fit max string size

On the updated builder image, the build is failing because the system
compiler has been updated to GCC 8.2.0.  It complains about the
possibility of overflow when putting one 30 character buffer plus 2
characters into another 30 character buffer.  To fix this, increase
the recipient buffer size by 2.

romcc.c:3645:2: note: 'sprintf' output between 3 and 32 bytes into a destination
of size 30 [-Werror=format-overflow=]
  sprintf(buf, "\"%s\"", scratch);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
romcc.c:3649:2: note: 'sprintf' output between 3 and 32 bytes into a destination
of size 30 [-Werror=format-overflow=]
  sprintf(buf, "\"%s\"", scratch);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: I7879a7202cc3ff52301b10118fc49fcc601f133e
Signed-off-by: Martin Roth <martinroth at google.com>
---
M util/romcc/romcc.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/29850/1

diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c
index 307fcf8..4cb2aad 100644
--- a/util/romcc/romcc.c
+++ b/util/romcc/romcc.c
@@ -3629,7 +3629,7 @@
 
 static void register_builtin_macros(struct compile_state *state)
 {
-	char buf[30];
+	char buf[32];
 	char scratch[30];
 	time_t now;
 	struct tm *tm;

-- 
To view, visit https://review.coreboot.org/c/coreboot/+/29850
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7879a7202cc3ff52301b10118fc49fcc601f133e
Gerrit-Change-Number: 29850
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth at google.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181127/db97e8b9/attachment.html>


More information about the coreboot-gerrit mailing list