From patchwork Sun May 26 23:24:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1105623 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.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="itGOHmZR"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45Bx5t34fvz9s3Z for ; Mon, 27 May 2019 09:24:47 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D78268792F; Sun, 26 May 2019 23:24:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DGdw61FWKu-I; Sun, 26 May 2019 23:24:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 6657B8774C; Sun, 26 May 2019 23:24:42 +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 87D461BF36A for ; Sun, 26 May 2019 23:24:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8340E2305A for ; Sun, 26 May 2019 23:24:41 +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 4eGEDM+s7YzD for ; Sun, 26 May 2019 23:24:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by silver.osuosl.org (Postfix) with ESMTPS id 16E712152C for ; Sun, 26 May 2019 23:24:40 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id c70so1165865qkg.7 for ; Sun, 26 May 2019 16:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Fwgh0oXADDl8yKE/f4b73fMInbqf72dgqSsuoMzhnqk=; b=itGOHmZRVWfenvk2VXs1OJGLyN9F82XVstEP4jcAUgesKFn9Mxs1XU6+3fCHg6DQrU rj67vocFTZC2nSXlRXUbaWeUndpKAUVoP79j3+Yn/UaIw6xzdyRQuhMBjkrKKhx+P3Gv jWP0leub4fcSaIBNfJsC3WNwdNCadmHLhjcQhk6Vy7aWQVeQSAWoHUBDg4NKrrivmNma Mspgl4Oh8mE7e+0lJrCcn49SkUVKKuP+GLNMwBK1bswDYxYn6qFmVAzc+tUJotdDOKZw W/nshH9Ah49rQV126LTO4mvAdpk+NJsMIYdHAElko2QTr+oXA47uwm+gQiA+zeINQAoZ QBMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Fwgh0oXADDl8yKE/f4b73fMInbqf72dgqSsuoMzhnqk=; b=PXvFYEBhxyNteA+PpRH8qn9Wf35y/7b9Y4H+9tRy5OcwsuGZU6I4ySN3M+vALi/Vhd bgJV6sD/nkMJoNmdCaHtgP7+7tVryBRwL8R5gm11nv2uWP92qpk2US+uh+qqDIJcL+MJ nyeRN16hly4JXDQbn9pmatp9xqHJlImDHOT1qbYjBw0sBvYhlaivIre3UIZt0Lrxi8QP UWEKlmceIr38itvPfGBtI3b18jw3UuuYDeIgwcE6Ve+MB/ESDw6eC1aS9ygNWJhRgPk/ uIMe+ONpykcB6M0iUgJKoNPXv/q96Pfr20W+t1eHCMXzfsW+vjrKzvsWEY80bJcTZ42x Ffgg== X-Gm-Message-State: APjAAAWzFeqr/FdutpG2sjH45E0aA8gt/GkMks8XLahkMtvvb1Kt3Jl0 oJgIUz9305t4957ZsZhRd2+56Pzz X-Google-Smtp-Source: APXvYqzB/L4DiBti72n6Wo8FZrHnCOFNBwqVcJZ9HxOg3bPE+5hlRQvQKnABwT2yTffHzmTG6wI+iw== X-Received: by 2002:a37:9483:: with SMTP id w125mr22296301qkd.242.1558913078887; Sun, 26 May 2019 16:24:38 -0700 (PDT) Received: from p7-1130br.casantos.org (189.27.176.128.dynamic.adsl.gvt.net.br. [189.27.176.128]) by smtp.gmail.com with ESMTPSA id m5sm164061qke.25.2019.05.26.16.24.36 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 26 May 2019 16:24:37 -0700 (PDT) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Sun, 26 May 2019 20:24:33 -0300 Message-Id: <20190526232433.31654-1-unixmania@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/tpm2-totp: fix error due to variable used uninitialized X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carlos Santos , Peter Korsgaard Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos Some inline declarations of strtok_r (specifically in Sourcery CodeBench Lite 2016.11-19) contain code where an '__s' local variable can be used uninitialized. When GCC expands that declaration in tpm2-totp, __s becomes an alias to a variable which fact is not initialized, but this is not relevant since the execution path leading to the uninitialized use is never followed. Anyway, apply a patch already submitted upstream to fix the compilation error. Upstream bug report: https://github.com/tpm2-software/tpm2-totp/issues/32 Fixes: http://autobuild.buildroot.net/results/5693a35e4d6bc76a1f46fe0e217abc49f7188aad/ Signed-off-by: Carlos Santos --- ...ion-failure-due-to-variable-may-be-u.patch | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 package/tpm2-totp/0002-src-fix-compilation-failure-due-to-variable-may-be-u.patch diff --git a/package/tpm2-totp/0002-src-fix-compilation-failure-due-to-variable-may-be-u.patch b/package/tpm2-totp/0002-src-fix-compilation-failure-due-to-variable-may-be-u.patch new file mode 100644 index 0000000000..a650ab49f4 --- /dev/null +++ b/package/tpm2-totp/0002-src-fix-compilation-failure-due-to-variable-may-be-u.patch @@ -0,0 +1,42 @@ +From 194f41635367452a7a3c9a75ebbada531bf4c58d Mon Sep 17 00:00:00 2001 +From: Carlos Santos +Date: Sun, 26 May 2019 13:39:44 -0300 +Subject: [PATCH] src: fix compilation failure due to "variable may be used + uninitialized" + +Some inline declarations of strtok_r (specifically in Sourcery CodeBench +Lite 2016.11-19) contain code where an '__s' local variable can be used +uninitialized. + +When GCC expands that declaration in 'parse_pcrs', __s becomes an alias +to the local variable 'saveptr', which in fact is not initialized, but +this is not relevant, since the 'str' argument is knowingly not NULL +when passed to strtok_r because it comes from 'optarg' in parse_opts. + +Anyway, initialize saveptr to NULL to prevent the compilation error. + +Fixes: + http://autobuild.buildroot.net/results/5693a35e4d6bc76a1f46fe0e217abc49f7188aad/ + +Change-Id: I03ad3731774c56744f18154ec161c92ba002903d +Signed-off-by: Carlos Santos +--- + src/tpm2-totp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tpm2-totp.c b/src/tpm2-totp.c +index 3f60b4a..f28a4d6 100644 +--- a/src/tpm2-totp.c ++++ b/src/tpm2-totp.c +@@ -93,7 +93,7 @@ int + parse_pcrs(char *str, int *pcrs) + { + char *token; +- char *saveptr; ++ char *saveptr = NULL; + char *endptr; + long pcr; + +-- +2.20.1 +