| .. | .. |
|---|
| 3 | 3 | * |
|---|
| 4 | 4 | * Module Name: dswstate - Dispatcher parse tree walk management routines |
|---|
| 5 | 5 | * |
|---|
| 6 | | - * Copyright (C) 2000 - 2018, Intel Corp. |
|---|
| 6 | + * Copyright (C) 2000 - 2020, Intel Corp. |
|---|
| 7 | 7 | * |
|---|
| 8 | 8 | *****************************************************************************/ |
|---|
| 9 | 9 | |
|---|
| .. | .. |
|---|
| 530 | 530 | |
|---|
| 531 | 531 | /* Init the method args/local */ |
|---|
| 532 | 532 | |
|---|
| 533 | | -#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY)) |
|---|
| 533 | +#ifndef ACPI_CONSTANT_EVAL_ONLY |
|---|
| 534 | 534 | acpi_ds_method_data_init(walk_state); |
|---|
| 535 | 535 | #endif |
|---|
| 536 | 536 | |
|---|
| .. | .. |
|---|
| 576 | 576 | ACPI_FUNCTION_TRACE(ds_init_aml_walk); |
|---|
| 577 | 577 | |
|---|
| 578 | 578 | walk_state->parser_state.aml = |
|---|
| 579 | | - walk_state->parser_state.aml_start = aml_start; |
|---|
| 580 | | - walk_state->parser_state.aml_end = |
|---|
| 581 | | - walk_state->parser_state.pkg_end = aml_start + aml_length; |
|---|
| 579 | + walk_state->parser_state.aml_start = |
|---|
| 580 | + walk_state->parser_state.aml_end = |
|---|
| 581 | + walk_state->parser_state.pkg_end = aml_start; |
|---|
| 582 | + /* Avoid undefined behavior: applying zero offset to null pointer */ |
|---|
| 583 | + if (aml_length != 0) { |
|---|
| 584 | + walk_state->parser_state.aml_end += aml_length; |
|---|
| 585 | + walk_state->parser_state.pkg_end += aml_length; |
|---|
| 586 | + } |
|---|
| 582 | 587 | |
|---|
| 583 | 588 | /* The next_op of the next_walk will be the beginning of the method */ |
|---|
| 584 | 589 | |
|---|