summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2010-03-30 09:59:23 +0000
committerStefan Reinauer <stepan@openbios.org>2010-03-30 09:59:23 +0000
commitfd0bef825d88fa75d0703569ed01e05066766826 (patch)
tree02be49ed6a84e12448c20fd9ed223c977d3cfe56 /util
parentc719f1a506060e6283352d114fd6d589e4c6ce3d (diff)
downloadcoreboot-fd0bef825d88fa75d0703569ed01e05066766826.tar.xz
build_opt_tbl: error instead of null pointer access if no checksum is defined.
xe7501devkit: If cmos.layout is used, there must be a checksum. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5327 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util')
-rw-r--r--util/options/build_opt_tbl.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/util/options/build_opt_tbl.c b/util/options/build_opt_tbl.c
index 910c49cce2..b4e4151dc1 100644
--- a/util/options/build_opt_tbl.c
+++ b/util/options/build_opt_tbl.c
@@ -608,9 +608,17 @@ int main(int argc, char **argv)
fprintf(fp, "#define CMOS_VLEN_%s %d\n",
ce->name, ce->length);
}
- fprintf(fp, "\n#define LB_CKS_RANGE_START %d\n", cs->range_start / 8);
- fprintf(fp, "#define LB_CKS_RANGE_END %d\n", cs->range_end / 8);
- fprintf(fp, "#define LB_CKS_LOC %d\n", cs->location / 8);
+
+ if (cs != NULL) {
+ fprintf(fp, "\n#define LB_CKS_RANGE_START %d\n", cs->range_start / 8);
+ fprintf(fp, "#define LB_CKS_RANGE_END %d\n", cs->range_end / 8);
+ fprintf(fp, "#define LB_CKS_LOC %d\n", cs->location / 8);
+ } else {
+ fprintf(stderr, "Error - No checksums defined.\n");
+ fclose(fp);
+ unlink(tempfilename);
+ exit(1);
+ }
fclose(fp);
UNLINK_IF_NECESSARY(header);