diff options
Diffstat (limited to 'source/compiler/aslcodegen.c')
| -rw-r--r-- | source/compiler/aslcodegen.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/compiler/aslcodegen.c b/source/compiler/aslcodegen.c index caaf983aea5d..901bc4b28bef 100644 --- a/source/compiler/aslcodegen.c +++ b/source/compiler/aslcodegen.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2026, Intel Corp. * All rights reserved. * * 2. License @@ -586,14 +586,16 @@ CgWriteTableHeader ( /* OEMID */ Child = Child->Asl.Next; - memcpy (AslGbl_TableHeader.OemId, Child->Asl.Value.String, - strlen (Child->Asl.Value.String)); + /* Bound copy to header field size to avoid overflow on malformed input */ + strncpy (AslGbl_TableHeader.OemId, Child->Asl.Value.String, + ACPI_OEM_ID_SIZE); /* OEM TableID */ Child = Child->Asl.Next; - memcpy (AslGbl_TableHeader.OemTableId, Child->Asl.Value.String, - strlen (Child->Asl.Value.String)); + /* Bound copy to header field size to avoid overflow on malformed input */ + strncpy (AslGbl_TableHeader.OemTableId, Child->Asl.Value.String, + ACPI_OEM_TABLE_ID_SIZE); /* OEM Revision */ |
