ifdtool: Provide bounds on string parser

While the result will not be pretty (ie. ifdtool will
mis-parse string components longer than 255 characters),
at least it doesn't overflow stack variables anymore.

Change-Id: I263c5cf823a2d8a863dcece7c4ee0b26475f9fc4
Found-by: Coverity Scan
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/6562
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Tested-by: build bot (Jenkins)
This commit is contained in:
Patrick Georgi 2014-08-09 17:12:23 +02:00
parent a438049422
commit 802ad52180
1 changed files with 1 additions and 1 deletions

View File

@ -761,7 +761,7 @@ void new_layout(char *filename, char *image, int size, char *layout_fname)
while (!feof(romlayout)) {
char *tstr1, *tstr2;
if (2 != fscanf(romlayout, "%s %s\n", tempstr,
if (2 != fscanf(romlayout, "%255s %255s\n", tempstr,
layout_region_name))
continue;