Attention is currently required from: Thomas Heijligen, Edward O'Callaghan, Angel Pons.
3 comments:
Patchset:
File cli_classic.c:
Patch Set #2, Line 541: struct flashrom_layout *layout = NULL;
The issue is not that `NULL` means 'no layout' but rather it is the attempted use of a layout before […]
Ultimately `layout` can still end up as NULL if no layout provided/found, so anything that uses it (e.g. get_region_range call below) should check it is non-null.
But we can't really get the compiler to enforce that since it only checks the variable has been initialized, and it doesn't check for initialized-to-non-null.
I'm ok with leaving layout set to NULL here instead of setting it to NULL in the new `else` block below.
An alternative would be to delete `default_layout` in `struct flashctx` and assign `flash->layout` to a default layout in `probe_flash()`. Then users can override the default `flash->layout` value if they want, and flash->layout will always be a valid layout.
Anyway I'm going to move this patch to the end since the other two are sufficient to fix the segfault.
Patch Set #2, Line 1110: msg_gdbg("Valid layout could not be found without image.\n");
Nik, can you come up with a better string here for your bug. […]
Maybe we should change it to "No layout provided or found in image", it's really just for debugging.
To view, visit change 67723. To unsubscribe, or for help writing mail filters, visit settings.