Skip to content

Commit 1035a3d

Browse files
committed
Apply ACPI_NONSTRING
Add ACPI_NONSTRING for destination char arrays without a terminating NUL character. This is a follow-up to ed68cb8 where not all instances received the same treatment, in preparation for replacing strncpy() calls with memcpy() Signed-off-by: Ahmed Salem <x0rw3ll@gmail.com>
1 parent 9f6f6cc commit 1035a3d

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

source/include/acdebug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ typedef struct acpi_db_execute_walk
187187
{
188188
UINT32 Count;
189189
UINT32 MaxCount;
190-
char NameSeg[ACPI_NAMESEG_SIZE + 1];
190+
char NameSeg[ACPI_NAMESEG_SIZE + 1] ACPI_NONSTRING;
191191

192192
} ACPI_DB_EXECUTE_WALK;
193193

source/include/actbl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@
213213

214214
typedef struct acpi_table_header
215215
{
216-
char Signature[ACPI_NAMESEG_SIZE]; /* ASCII table signature */
216+
char Signature[ACPI_NAMESEG_SIZE] ACPI_NONSTRING; /* ASCII table signature */
217217
UINT32 Length; /* Length of table in bytes, including this header */
218218
UINT8 Revision; /* ACPI Specification minor version number */
219219
UINT8 Checksum; /* To make sum of entire table == 0 */
220-
char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
221-
char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
220+
char OemId[ACPI_OEM_ID_SIZE] ACPI_NONSTRING; /* ASCII OEM identification */
221+
char OemTableId[ACPI_OEM_TABLE_ID_SIZE] ACPI_NONSTRING; /* ASCII OEM table identification */
222222
UINT32 OemRevision; /* OEM revision number */
223223
char AslCompilerId[ACPI_NAMESEG_SIZE]; /* ASCII ASL compiler vendor ID */
224224
UINT32 AslCompilerRevision; /* ASL compiler version */

source/os_specific/service_layers/oslinuxtbl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ typedef struct osl_table_info
167167
{
168168
struct osl_table_info *Next;
169169
UINT32 Instance;
170-
char Signature[ACPI_NAMESEG_SIZE];
170+
char Signature[ACPI_NAMESEG_SIZE] ACPI_NONSTRING;
171171

172172
} OSL_TABLE_INFO;
173173

source/tools/acpidump/apfiles.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ ApWriteToBinaryFile (
264264
ACPI_TABLE_HEADER *Table,
265265
UINT32 Instance)
266266
{
267-
char Filename[ACPI_NAMESEG_SIZE + 16];
267+
char Filename[ACPI_NAMESEG_SIZE + 16] ACPI_NONSTRING;
268268
char InstanceStr [16];
269269
ACPI_FILE File;
270270
ACPI_SIZE Actual;

0 commit comments

Comments
 (0)