mirror of https://github.com/acpica/acpica/
ACPI_PCI_ROUTING_TABLE: Replace fixed-size array with flex array member
The "Source" array is actually a dynamically sized array, but it is defined as a fixed-size 4 byte array. This results in tripping both compile-time and run-time bounds checkers (e.g. via either __builtin_object_size() or -fsanitize=bounds). To retain the padding, create a union with an unused Pad variable of size 4, and redefine Source as a proper flexible array member.
This commit is contained in:
parent
8a8443112b
commit
b1c7901e10
|
@ -927,8 +927,10 @@ typedef struct acpi_pci_routing_table
|
|||
UINT32 Pin;
|
||||
UINT64 Address; /* here for 64-bit alignment */
|
||||
UINT32 SourceIndex;
|
||||
char Source[4]; /* pad to 64 bits so sizeof() works in all cases */
|
||||
|
||||
union {
|
||||
char Pad[4]; /* pad to 64 bits so sizeof() works in all cases */
|
||||
ACPI_FLEX_ARRAY(char, Source);
|
||||
};
|
||||
} ACPI_PCI_ROUTING_TABLE;
|
||||
|
||||
#endif /* __ACRESTYP_H__ */
|
||||
|
|
Loading…
Reference in New Issue