diff options
author | Robert Moore <Robert.Moore@intel.com> | 2014-02-19 13:36:26 -0800 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2014-02-19 13:36:26 -0800 |
commit | 8cd261550dad1951057ebf338ebcfde1d9d58612 (patch) | |
tree | 0652b51c38f5b74b66023e52e320ddb9d20b04a0 | |
parent | 24fd86c118307410632cf2bcb7ae2e224695eea7 (diff) |
Debugger: Add additional error checks for user input/namespace nodes.
Fix a couple of missed cases and improve error message(s).
With assistance from Colin Ian King. ACPICA BZ 1048.
-rw-r--r-- | source/components/debugger/dbcmds.c | 8 | ||||
-rw-r--r-- | source/components/debugger/dbmethod.c | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c index b0d1cc16e..747744be5 100644 --- a/source/components/debugger/dbcmds.c +++ b/source/components/debugger/dbcmds.c @@ -188,7 +188,7 @@ AcpiDbConvertToNode ( Node = ACPI_TO_POINTER (Address); if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE))) { - AcpiOsPrintf ("Address %p is invalid in this address space\n", + AcpiOsPrintf ("Address %p is invalid", Node); return (NULL); } @@ -197,7 +197,7 @@ AcpiDbConvertToNode ( if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED) { - AcpiOsPrintf ("Address %p is not a valid NS node [%s]\n", + AcpiOsPrintf ("Address %p is not a valid namespace node [%s]\n", Node, AcpiUtGetDescriptorName (Node)); return (NULL); } @@ -211,6 +211,8 @@ AcpiDbConvertToNode ( Node = AcpiDbLocalNsLookup (InString); if (!Node) { + AcpiOsPrintf ("Could not find [%s] in namespace, defaulting to root node\n", + InString); Node = AcpiGbl_RootNode; } } @@ -512,8 +514,6 @@ AcpiDbUnloadAcpiTable ( Node = AcpiDbConvertToNode (ObjectName); if (!Node) { - AcpiOsPrintf ("Could not find [%s] in namespace\n", - ObjectName); return; } diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c index f21cff96f..39a9fa738 100644 --- a/source/components/debugger/dbmethod.c +++ b/source/components/debugger/dbmethod.c @@ -252,6 +252,11 @@ AcpiDbSetMethodData ( if (Type == 'N') { Node = AcpiDbConvertToNode (IndexArg); + if (!Node) + { + return; + } + if (Node->Type != ACPI_TYPE_INTEGER) { AcpiOsPrintf ("Can only set Integer nodes\n"); |