Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/acpica/dist/tables Correct misaligned point...
details: https://anonhg.NetBSD.org/src/rev/b24864dbfcf4
branches: trunk
changeset: 999311:b24864dbfcf4
user: kamil <kamil%NetBSD.org@localhost>
date: Tue May 28 13:34:40 2019 +0000
description:
Correct misaligned pointer dereference of type UINT32 in ACPICA
Detected with kUBSan.
diffstat:
sys/external/bsd/acpica/dist/tables/tbutils.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (15 lines):
diff -r 1bc0efeb164e -r b24864dbfcf4 sys/external/bsd/acpica/dist/tables/tbutils.c
--- a/sys/external/bsd/acpica/dist/tables/tbutils.c Tue May 28 13:24:25 2019 +0000
+++ b/sys/external/bsd/acpica/dist/tables/tbutils.c Tue May 28 13:34:40 2019 +0000
@@ -228,8 +228,9 @@
* 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)));
+ UINT32 addr;
+ memcpy(&addr, ACPI_CAST_PTR (UINT32, TableEntry), sizeof(addr));
+ return (ACPI_PHYSICAL_ADDRESS) addr;
}
else
{
Home |
Main Index |
Thread Index |
Old Index