Skip to content

Commit

Permalink
ACPICA: debugger: check status of AcpiEvaluateObject in AcpiDbWalkFor…
Browse files Browse the repository at this point in the history
…Fields

Errors in AcpiEvaluateObject can lead to incorrect state of Buffer.
This can lead to access to data in previously ACPI_FREEd Buffer and
secondary ACPI_FREE to the same Buffer later.

Handle errors in AcpiEvaluateObject the same way it is done earlier
with AcpiNsHandleToPathname.
  • Loading branch information
nkiryushin committed Feb 12, 2024
1 parent a6a236c commit 9061cd9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/components/debugger/dbnames.c
Expand Up @@ -774,7 +774,12 @@ AcpiDbWalkForFields (
ACPI_FREE (Buffer.Pointer);

Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
AcpiEvaluateObject (ObjHandle, NULL, NULL, &Buffer);
Status = AcpiEvaluateObject (ObjHandle, NULL, NULL, &Buffer);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could Not evaluate object %p\n", ObjHandle);
return (AE_OK);
}

/*
* Since this is a field unit, surround the output in braces
Expand Down

0 comments on commit 9061cd9

Please sign in to comment.