Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/52888 )
Change subject: util/sconfig: Fix null pointer dereferences ......................................................................
util/sconfig: Fix null pointer dereferences
Should use `name` instead of `field->name`, because `field is supposed to be NULL at this point.
TEST=add new field from bits 29-64 to volteer, ensure sconfig prints an error instead of segfaulting.
Change-Id: I933330494e0b10e8494a92e93d6beb58fbec0bc1 Found-by: Coverity CID 1452916 Signed-off-by: Tim Wawrzynczak twawrzynczak@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/52888 Reviewed-by: Duncan Laurie Reviewed-by: Furquan Shaikh furquan@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M util/sconfig/main.c 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Duncan Laurie: Looks good to me, approved Furquan Shaikh: Looks good to me, approved
diff --git a/util/sconfig/main.c b/util/sconfig/main.c index 111bb50..e2a0586 100644 --- a/util/sconfig/main.c +++ b/util/sconfig/main.c @@ -450,7 +450,7 @@ tmp = bits; while (tmp) { if (tmp->start_bit > tmp->end_bit || tmp->end_bit > 63) { - printf("ERROR: fw_config field %s has invalid range %u-%u\n", field->name, + printf("ERROR: fw_config field %s has invalid range %u-%u\n", name, tmp->start_bit, tmp->end_bit); exit(1); }