mirror of
https://github.com/acpica/acpica/
synced 2025-02-25 18:04:08 +03:00
Check for string constant maximum length (200)
This commit is contained in:
parent
8b324e8ae2
commit
4fddfa75f3
@ -3,7 +3,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslcompiler.l - Flex input file
|
||||
* $Revision: 1.73 $
|
||||
* $Revision: 1.74 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -932,6 +932,7 @@ literal (void)
|
||||
UINT32 State = ASL_NORMAL_CHAR;
|
||||
UINT32 i = 0;
|
||||
UINT8 Digit;
|
||||
UINT8 StringLength = 0;
|
||||
char ConvertBuffer[4];
|
||||
|
||||
|
||||
@ -943,6 +944,17 @@ literal (void)
|
||||
InsertLineBuffer ('\"');
|
||||
while ((StringChar = (char) input()) != EOF)
|
||||
{
|
||||
StringLength++;
|
||||
if (StringLength == ACPI_MAX_STRING_CONVERSION)
|
||||
{
|
||||
/* Emit error only once, but keep going */
|
||||
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_STRING_LENGTH,
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
}
|
||||
|
||||
InsertLineBuffer (StringChar);
|
||||
|
||||
DoCharacter:
|
||||
|
@ -2,7 +2,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: asltypes.h - compiler data types and struct definitions
|
||||
* $Revision: 1.77 $
|
||||
* $Revision: 1.78 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -396,6 +396,7 @@ typedef enum
|
||||
ASL_MSG_SEEK,
|
||||
ASL_MSG_SINGLE_NAME_OPTIMIZATION,
|
||||
ASL_MSG_SOME_NO_RETVAL,
|
||||
ASL_MSG_STRING_LENGTH,
|
||||
ASL_MSG_SWITCH_TYPE,
|
||||
ASL_MSG_SYNC_LEVEL,
|
||||
ASL_MSG_SYNTAX,
|
||||
@ -503,6 +504,7 @@ char *AslMessages [] = {
|
||||
/* ASL_MSG_SEEK */ "Could not seek file",
|
||||
/* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)",
|
||||
/* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value",
|
||||
/* ASL_MSG_STRING_LENGTH */ "String constant too long (200 max)",
|
||||
/* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
|
||||
/* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15",
|
||||
/* ASL_MSG_SYNTAX */ "",
|
||||
|
Loading…
x
Reference in New Issue
Block a user