about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-02-05 12:45:08 -0500
committerGitHub <noreply@github.com>2017-02-05 12:45:08 -0500
commitae3aafacdfeb4a3a1133239a15ec9e3bb7750bd5 (patch)
tree19fa4c092927e1246ff4c1c0caf20a4772310cfb
parentac329cd122185078d10711a0f2f1d4331cd1e3f6 (diff)
parentd14b268b9d0f37811c47cc6b1ebf2433fbb0ad0e (diff)
downloadrust-ae3aafacdfeb4a3a1133239a15ec9e3bb7750bd5.tar.gz
rust-ae3aafacdfeb4a3a1133239a15ec9e3bb7750bd5.zip
Rollup merge of #39509 - petrochenkov:rb2, r=alexcrichton
libbacktrace: Fix uninitialized variable

Fixes https://github.com/rust-lang/rust/issues/39468
-rw-r--r--src/libbacktrace/pecoff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libbacktrace/pecoff.c b/src/libbacktrace/pecoff.c
index 04e0bafb149..2d6a9877219 100644
--- a/src/libbacktrace/pecoff.c
+++ b/src/libbacktrace/pecoff.c
@@ -607,7 +607,9 @@ coff_add (struct backtrace_state *state, int descriptor,
   //       against the upstream libbacktrace, that's what's going on.
   uint32_t str_size;
   off_t str_off;
-  struct backtrace_view syms_view;
+  // NOTE: upstream doesn't have `{0}`, this is a fix for Rust issue #39468.
+  //       If syms_view is not initialized, then `free(syms_view.base)` may segfault later.
+  struct backtrace_view syms_view = {0};
   off_t syms_off;
   size_t syms_size;
   int syms_view_valid;