ACK: [PATCH] acpi: syntaxcheck: nullify pointers to clean up static analysis warnings
ivanhu
ivan.hu at canonical.com
Tue Jun 11 05:45:29 UTC 2019
On 6/10/19 7:26 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> The fwts_iasl_reassemble call potentially may not set the iasl_stdout,
> iasl_stderr and iasl_disassembly pointers, so initialize these to NULL
> so that the fwts_text_list_free calls won't hit uninitialized pointer
> reads if fwts_iasl_reassemble fails.
>
> Addresses-Coverity: ("Uninitialized pointer read")
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/acpi/syntaxcheck/syntaxcheck.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/acpi/syntaxcheck/syntaxcheck.c b/src/acpi/syntaxcheck/syntaxcheck.c
> index 03a28b2c..8ba1dc2f 100644
> --- a/src/acpi/syntaxcheck/syntaxcheck.c
> +++ b/src/acpi/syntaxcheck/syntaxcheck.c
> @@ -495,7 +495,9 @@ static int syntaxcheck_single_table(
> int errors = 0;
> int warnings = 0;
> int remarks = 0;
> - fwts_list *iasl_stdout, *iasl_stderr, *iasl_disassembly;
> + fwts_list *iasl_stdout = NULL,
> + *iasl_stderr = NULL,
> + *iasl_disassembly = NULL;
>
> if (fwts_iasl_reassemble(fw, info,
> &iasl_disassembly, &iasl_stdout, &iasl_stderr) != FWTS_OK) {
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list