Edward O'Callaghan uploaded patch set #2 to this change.
programmer.h: Convert anon union to anon struct
Convert the anon union of registered masters in the mst
field of the flashctx to a anon struct. If we are going
to dereference a pointer there in an undefined way we
should crash and not plow ahead with invalid memory.
i.e., As a minimal example,
```
struct idk {
struct {
int *a;
int *b;
};
};
int main()
{
struct idk foo = {0};
int i = 12;
foo.a = &i;
printf("%d\n", *foo.b);
return 0;
}
```
The user of the registered_masters type is therefore
responsible for querying the buses_supported field before
attempting to dereference a ptr field in the anon struct.
BUG=?
TEST=<needed>
Change-Id: I576967a8599b923c902e39f177f39146291cc242
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
---
M programmer.h
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/46/50246/2
To view, visit change 50246. To unsubscribe, or for help writing mail filters, visit settings.