From patchwork Sun Mar 25 03:59:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 890606 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=datacom.ind.br Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4083TF2mVLz9s1c for ; Sun, 25 Mar 2018 15:00:17 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9097F884BD; Sun, 25 Mar 2018 04:00:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R5kAo9KbhGF5; Sun, 25 Mar 2018 04:00:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 648EB884AC; Sun, 25 Mar 2018 04:00:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 275651C0485 for ; Sun, 25 Mar 2018 04:00:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 24AA2227AC for ; Sun, 25 Mar 2018 04:00:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q9yrpDd+zitA for ; Sun, 25 Mar 2018 04:00:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.ind.br (mx.datacom.ind.br [177.66.5.10]) by silver.osuosl.org (Postfix) with ESMTPS id 318E6227A7 for ; Sun, 25 Mar 2018 04:00:06 +0000 (UTC) Received: from mail.datacom.ind.br (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTPS id 69DF11BA034D; Sun, 25 Mar 2018 01:00:09 -0300 (-03) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTP id 54A081BA0338; Sun, 25 Mar 2018 01:00:09 -0300 (-03) Received: from mail.datacom.ind.br ([127.0.0.1]) by localhost (mail.datacom.ind.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ju3nCZ_Dmc7c; Sun, 25 Mar 2018 01:00:09 -0300 (-03) Received: from p7-1130br.casantos.org (unknown [177.18.152.199]) by mail.datacom.ind.br (Postfix) with ESMTPSA id E8C6A1BA03AA; Sun, 25 Mar 2018 01:00:08 -0300 (-03) From: Carlos Santos To: buildroot@buildroot.org Date: Sun, 25 Mar 2018 00:59:53 -0300 Message-Id: <20180325035953.25906-3-casantos@datacom.ind.br> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180325035953.25906-1-casantos@datacom.ind.br> References: <20180325035953.25906-1-casantos@datacom.ind.br> Subject: [Buildroot] [PATCH 2/2] tpm2-tools: fix compilation error due to uninitialized variable X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas De Schampheleire , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Backport a patch alreary submitted upstream, at https://github.com/tpm2-software/tpm2-tools/pull/954 Fixes: http://autobuild.buildroot.net/results/ae1e151576b365380ab711a1b8ffcd92ad0050e2 http://autobuild.buildroot.net/results/ee80c2fe54c89589532efd47eb93bd27637c690f Signed-off-by: Carlos Santos --- ...y-fix-type-may-be-used-uninitialized-warn.patch | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 package/tpm2-tools/0001-tpm2_certify-fix-type-may-be-used-uninitialized-warn.patch diff --git a/package/tpm2-tools/0001-tpm2_certify-fix-type-may-be-used-uninitialized-warn.patch b/package/tpm2-tools/0001-tpm2_certify-fix-type-may-be-used-uninitialized-warn.patch new file mode 100644 index 0000000000..b472666f46 --- /dev/null +++ b/package/tpm2-tools/0001-tpm2_certify-fix-type-may-be-used-uninitialized-warn.patch @@ -0,0 +1,36 @@ +From e15b01a1eb27e31964308892fcaa9c7d4f17f181 Mon Sep 17 00:00:00 2001 +From: Carlos Santos +Date: Sat, 24 Mar 2018 22:46:46 -0300 +Subject: [PATCH] tpm2_certify: fix "'type' may be used uninitialized" warning + +get_key_type does not assign a value to 'type' on error conditions, +which makes the compiler believe that it will be used uninitialized in +the LOG_ERR call, in set_scheme. In practice this will never happen +because set_scheme returns immediately if get_key_type retuns false but +the compiler does not understand that logic and fails because warnings +are treated as errors. + +Adapted for version 3.0.3 from the change submitted upstream: + + https://github.com/tpm2-software/tpm2-tools/pull/954 + +Signed-off-by: Carlos Santos +--- + tools/tpm2_certify.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/tpm2_certify.c b/tools/tpm2_certify.c +index eaac02f..cbc42a9 100644 +--- a/tools/tpm2_certify.c ++++ b/tools/tpm2_certify.c +@@ -107,6 +107,7 @@ static bool get_key_type(TSS2_SYS_CONTEXT *sapi_context, TPMI_DH_OBJECT object_h + &out_public, &name, &qualified_name, &sessions_data_out)); + if (rval != TPM_RC_SUCCESS) { + LOG_ERR("TPM2_ReadPublic failed. Error Code: 0x%x", rval); ++ *type = TPM_ALG_ERROR; + return false; + } + +-- +2.14.3 +