This patch fixes a segfault when a file too large to fit is added to a rom

image.

Signed-off-by: Ward Vandewege <ward@gnu.org>
Acked-by: Myles Watson <mylesgw@gmail.com>




git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4283 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Ward Vandewege 2009-05-13 20:11:04 +00:00
parent a064b5239d
commit df042a18ec
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ struct cbfs_file * rom_alloc(struct rom *rom, const char *name, unsigned long si
{
/* walk the rom and find an empty file with a base > base, and a large enough size */
unsigned int offset = ntohl(rom->header->offset);
unsigned int ret = -1;
int ret = -1;
struct cbfs_file *c = NULL;
unsigned long nextoffset, truncoffset;
struct cbfs_file *newfile = NULL;