Author: tfaber
Date: Fri Apr 14 09:32:47 2017
New Revision: 74300
URL:
http://svn.reactos.org/svn/reactos?rev=74300&view=rev
Log:
[ACPI]
- Ensure null termination of the method name passed to AcpiEvaluateObject in
Bus_PDO_EvalMethod. Spotted by ReactCoder.
CORE-13068 #resolve
Modified:
trunk/reactos/drivers/bus/acpi/eval.c
Modified: trunk/reactos/drivers/bus/acpi/eval.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/eval.c?re…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/eval.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/eval.c [iso-8859-1] Fri Apr 14 09:32:47 2017
@@ -17,6 +17,7 @@
PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER *SimpleInt;
ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING *SimpleStr;
+ CHAR MethodName[5];
if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < sizeof(ULONG))
return STATUS_INVALID_PARAMETER;
@@ -67,8 +68,12 @@
return STATUS_NOT_IMPLEMENTED;
}
+ RtlCopyMemory(MethodName,
+ EvalInputBuff->MethodName,
+ sizeof(EvalInputBuff->MethodName));
+ MethodName[4] = ANSI_NULL;
Status = AcpiEvaluateObject(DeviceData->AcpiHandle,
- (CHAR*)EvalInputBuff->MethodName,
+ MethodName,
&ParamList,
&RetBuff);