Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: james.hilliard1 at gmail.com <james.hilliard1@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] package/gcc: Initialize st in elf_is_symlink
Date: Mon, 18 Mar 2019 09:59:33 +0800	[thread overview]
Message-ID: <20190318015933.3478-1-james.hilliard1@gmail.com> (raw)

From: James Hilliard <james.hilliard1@gmail.com>

Fixes:
../../../../libsanitizer/libbacktrace/../../libbacktrace/elf.c: In function ?elf_is_symlink?:
../../../../libsanitizer/libbacktrace/../../libbacktrace/elf.c:772:21: error: ?st.st_mode? may be used uninitialized in this function [-Werror=maybe-uninitialized]
   return S_ISLNK (st.st_mode);
                     ^

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 ...race-Initialize-st-in-elf_is_symlink.patch | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 package/gcc/8.3.0/0001-libbacktrace-Initialize-st-in-elf_is_symlink.patch

diff --git a/package/gcc/8.3.0/0001-libbacktrace-Initialize-st-in-elf_is_symlink.patch b/package/gcc/8.3.0/0001-libbacktrace-Initialize-st-in-elf_is_symlink.patch
new file mode 100644
index 0000000000..22a6c38209
--- /dev/null
+++ b/package/gcc/8.3.0/0001-libbacktrace-Initialize-st-in-elf_is_symlink.patch
@@ -0,0 +1,32 @@
+From a6c384f38421ed62d5acac30a90dc92de5cf4055 Mon Sep 17 00:00:00 2001
+From: James Hilliard <james.hilliard1@gmail.com>
+Date: Mon, 18 Mar 2019 09:17:39 +0800
+Subject: [PATCH] [libbacktrace] Initialize st in elf_is_symlink
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes error: ?st.st_mode? may be used uninitialized in this function
+
+Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
+[Upstream status: https://patchwork.ozlabs.org/patch/1057631/]
+---
+ libbacktrace/elf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c
+index f4863f0bea5..6cc2a7dec22 100644
+--- a/libbacktrace/elf.c
++++ b/libbacktrace/elf.c
+@@ -765,7 +765,7 @@ elf_syminfo (struct backtrace_state *state, uintptr_t addr,
+ static int
+ elf_is_symlink (const char *filename)
+ {
+-  struct stat st;
++  struct stat st={0};
+ 
+   if (lstat (filename, &st) < 0)
+     return 0;
+-- 
+2.17.1
+
-- 
2.17.1

             reply	other threads:[~2019-03-18  1:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18  1:59 james.hilliard1 at gmail.com [this message]
2019-03-18 21:14 ` [Buildroot] [PATCH 1/1] package/gcc: Initialize st in elf_is_symlink Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190318015933.3478-1-james.hilliard1@gmail.com \
    --to=james.hilliard1@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox