Make sure the address variable is initialized to zero - it is only set when a
authorWard Vandewege <ward@gnu.org>
Thu, 18 Jun 2009 16:38:35 +0000 (16:38 +0000)
committerWard Vandewege <ward@gnu.org>
Thu, 18 Jun 2009 16:38:35 +0000 (16:38 +0000)
[base address] parameter is supplied on the command line... This patch fixes
random segfaults when using 'cbfstool add'.

Signed-off-by: Ward Vandewege <ward@gnu.org>
Acked-by: Myles Watson <mylesgw@gmail.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4363 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

util/cbfstool/add.c

index 9950d5bdf9daf6bfee9ca676a28a55d6576518c8..95b785298308a782448943be5709e2fcbaa9ab2b 100644 (file)
@@ -238,7 +238,7 @@ int select_component_type(char *s)
 int add_handler(struct rom *rom, int argc, char **argv)
 {
        unsigned int type = CBFS_COMPONENT_NULL;
-       unsigned long address;
+       unsigned long address = 0;
 
        if ((argc < 3) || (argc >  4)) {
                add_usage();