diff options
Diffstat (limited to 'sys/contrib/dev/acpica/components/debugger/dbexec.c')
-rw-r--r-- | sys/contrib/dev/acpica/components/debugger/dbexec.c | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/sys/contrib/dev/acpica/components/debugger/dbexec.c b/sys/contrib/dev/acpica/components/debugger/dbexec.c index 2566e2dbcc64..da907842e062 100644 --- a/sys/contrib/dev/acpica/components/debugger/dbexec.c +++ b/sys/contrib/dev/acpica/components/debugger/dbexec.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include <contrib/dev/acpica/include/acpi.h> #include <contrib/dev/acpica/include/accommon.h> #include <contrib/dev/acpica/include/acdebug.h> @@ -62,7 +61,7 @@ AcpiDbExecuteMethod ( ACPI_DB_METHOD_INFO *Info, ACPI_BUFFER *ReturnObj); -static void +static ACPI_STATUS AcpiDbExecuteSetup ( ACPI_DB_METHOD_INFO *Info); @@ -237,10 +236,15 @@ Cleanup: * ******************************************************************************/ -static void +static ACPI_STATUS AcpiDbExecuteSetup ( ACPI_DB_METHOD_INFO *Info) { + ACPI_STATUS Status; + + + ACPI_FUNCTION_NAME (DbExecuteSetup); + /* Catenate the current scope to the supplied name */ @@ -248,10 +252,21 @@ AcpiDbExecuteSetup ( if ((Info->Name[0] != '\\') && (Info->Name[0] != '/')) { - ACPI_STRCAT (Info->Pathname, AcpiGbl_DbScopeBuf); + if (AcpiUtSafeStrcat (Info->Pathname, sizeof (Info->Pathname), + AcpiGbl_DbScopeBuf)) + { + Status = AE_BUFFER_OVERFLOW; + goto ErrorExit; + } + } + + if (AcpiUtSafeStrcat (Info->Pathname, sizeof (Info->Pathname), + Info->Name)) + { + Status = AE_BUFFER_OVERFLOW; + goto ErrorExit; } - ACPI_STRCAT (Info->Pathname, Info->Name); AcpiDbPrepNamestring (Info->Pathname); AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); @@ -269,6 +284,13 @@ AcpiDbExecuteSetup ( AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); } + + return (AE_OK); + +ErrorExit: + + ACPI_EXCEPTION ((AE_INFO, Status, "During setup for method execution")); + return (Status); } @@ -429,7 +451,12 @@ AcpiDbExecute ( ReturnObj.Pointer = NULL; ReturnObj.Length = ACPI_ALLOCATE_BUFFER; - AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo); + Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (NameString); + return; + } /* Get the NS node, determines existence also */ @@ -729,7 +756,11 @@ AcpiDbCreateExecutionThreads ( AcpiDbUint32ToHexString (NumThreads, AcpiGbl_DbMethodInfo.NumThreadsStr); - AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo); + Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo); + if (ACPI_FAILURE (Status)) + { + goto CleanupAndExit; + } /* Get the NS node, determines existence also */ |