Skip to content

Commit

Permalink
Rollup merge of rust-lang#39509 - petrochenkov:rb2, r=alexcrichton
Browse files Browse the repository at this point in the history
libbacktrace: Fix uninitialized variable

Fixes rust-lang#39468
  • Loading branch information
frewsxcv authored Feb 5, 2017
2 parents ac329cd + d14b268 commit ae3aafa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libbacktrace/pecoff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ae3aafa

Please sign in to comment.