From patchwork Mon Jul 1 14:01:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erico Nunes X-Patchwork-Id: 1125363 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45cpvv05z4z9sPF; Tue, 2 Jul 2019 00:02:01 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hhwsX-0001YC-IF; Mon, 01 Jul 2019 14:01:57 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1hhwsV-0001Y2-NY for fwts-devel@lists.ubuntu.com; Mon, 01 Jul 2019 14:01:55 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B12753B702 for ; Mon, 1 Jul 2019 14:01:46 +0000 (UTC) Received: from ernunes.brq.redhat.com (unknown [10.43.2.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0DA046928C; Mon, 1 Jul 2019 14:01:45 +0000 (UTC) From: Erico Nunes To: fwts-devel@lists.ubuntu.com Subject: [PATCH] dsddump: fix segfault on type ACPI_TYPE_LOCAL_REFERENCE Date: Mon, 1 Jul 2019 16:01:18 +0200 Message-Id: <20190701140118.25282-1-ernunes@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 01 Jul 2019 14:01:46 +0000 (UTC) X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" The ACPI_BUFFER on dsddump print_package_element was unitialized and caused a segfault running on platforms with a _DSD containing ACPI_TYPE_LOCAL_REFERENCE. Signed-off-by: Erico Nunes Acked-by: Colin Ian King Acked-by: Alex Hung --- src/acpi/dsddump/dsddump.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/acpi/dsddump/dsddump.c b/src/acpi/dsddump/dsddump.c index c4e0610b..c60ba20e 100644 --- a/src/acpi/dsddump/dsddump.c +++ b/src/acpi/dsddump/dsddump.c @@ -55,6 +55,9 @@ static void print_package_element(fwts_framework *fw, ACPI_OBJECT *obj) ACPI_STATUS status; ACPI_BUFFER buffer; + buffer.Length = sizeof(full_name); + buffer.Pointer = full_name; + switch (obj->Type) { case ACPI_TYPE_INTEGER: fwts_log_info_verbatim(fw, " Value: 0x%8.8" PRIx64, obj->Integer.Value);