summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaket Dumbre <97769119+sacdintel@users.noreply.github.com>2023-03-22 15:37:36 -0700
committerGitHub <noreply@github.com>2023-03-22 15:37:36 -0700
commit76bfedddb407aa35fec4c018381e476db27544c3 (patch)
treeb56a1ed853e6e08a590d7369d19a232c15d02fae
parent4cd8ab6dec589352cbdf9fe735cf89f21ff378d1 (diff)
parent807665510f1ea71bbdc063c27782a1da56e8e10a (diff)
downloadacpica-76bfedddb407aa35fec4c018381e476db27544c3.tar.gz
Merge pull request #847 from tamird/ub-load-of-misaligned-address
Avoid undefined behavior: load of misaligned address
-rw-r--r--source/components/tables/tbutils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c
index d86ed252a..680a69d9f 100644
--- a/source/components/tables/tbutils.c
+++ b/source/components/tables/tbutils.c
@@ -323,6 +323,7 @@ AcpiTbGetRootTableEntry (
UINT8 *TableEntry,
UINT32 TableEntrySize)
{
+ UINT32 Address32;
UINT64 Address64;
@@ -336,8 +337,8 @@ AcpiTbGetRootTableEntry (
* 32-bit platform, RSDT: Return 32-bit table entry
* 64-bit platform, RSDT: Expand 32-bit to 64-bit and return
*/
- return ((ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST_PTR (
- UINT32, TableEntry)));
+ ACPI_MOVE_32_TO_32(&Address32, TableEntry);
+ return Address32;
}
else
{