This patch fixes a segfault when a file too large to fit is added to a rom
authorWard Vandewege <ward@gnu.org>
Wed, 13 May 2009 20:11:04 +0000 (20:11 +0000)
committerWard Vandewege <ward@gnu.org>
Wed, 13 May 2009 20:11:04 +0000 (20:11 +0000)
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

util/cbfstool/fs.c

index f617159563aba6f1b6fcaa3944d714bca895c54f..a3a1cc1d3bbdc3b4f5979072eadef580f92d4b97 100644 (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;