summaryrefslogtreecommitdiff
path: root/source/components/disassembler/dmcstyle.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2015-04-09 23:08:47 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2015-04-09 23:08:47 +0000
commitd29c30140bd8ea81e0530ad3975c977891ab9275 (patch)
tree7a91c0da98a89b4b10beda84d027d2c779673064 /source/components/disassembler/dmcstyle.c
parent2872953d4a9c9c4e0fc0b9ab37d0e962909625a0 (diff)
Notes
Diffstat (limited to 'source/components/disassembler/dmcstyle.c')
-rw-r--r--source/components/disassembler/dmcstyle.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/source/components/disassembler/dmcstyle.c b/source/components/disassembler/dmcstyle.c
index 1f1381969f57..71aef9b0e9fb 100644
--- a/source/components/disassembler/dmcstyle.c
+++ b/source/components/disassembler/dmcstyle.c
@@ -114,12 +114,20 @@ AcpiDmCheckForSymbolicOpcode (
Child1 = AcpiPsGetArg (Op, 0);
if (!Child1)
{
+ /* Parse tree may be confused or corrupted */
+
return (FALSE);
}
/* Get the second operand */
Child2 = Child1->Common.Next;
+ if (!Child2)
+ {
+ /* Parse tree may be confused or corrupted */
+
+ return (FALSE);
+ }
/* Setup the operator string for this opcode */
@@ -299,8 +307,16 @@ AcpiDmCheckForSymbolicOpcode (
/* Target is 3rd operand */
Target = Child2->Common.Next;
+
if (Op->Common.AmlOpcode == AML_DIVIDE_OP)
{
+ if (!Target)
+ {
+ /* Parse tree may be confused or corrupted */
+
+ return (FALSE);
+ }
+
/*
* Divide has an extra target operand (Remainder).
* If this extra target is specified, it cannot be converted
@@ -403,6 +419,13 @@ AcpiDmCheckForSymbolicOpcode (
/* Target is optional, 3rd operand */
Target = Child2->Common.Next;
+ if (!Target)
+ {
+ /* Parse tree may be confused or corrupted */
+
+ return (FALSE);
+ }
+
if (AcpiDmIsValidTarget (Target))
{
AcpiDmPromoteTarget (Op, Target);
@@ -423,6 +446,13 @@ AcpiDmCheckForSymbolicOpcode (
* source so that the target is processed first.
*/
Target = Child1->Common.Next;
+ if (!Target)
+ {
+ /* Parse tree may be confused or corrupted */
+
+ return (FALSE);
+ }
+
AcpiDmPromoteTarget (Op, Target);
if (!Target->Common.OperatorSymbol)