Skip to content

Commit d14b268

Browse files
committedFeb 3, 2017
libbacktrace: Fix uninitialized variable
1 parent b4abb72 commit d14b268

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/libbacktrace/pecoff.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,9 @@ coff_add (struct backtrace_state *state, int descriptor,
607607
// against the upstream libbacktrace, that's what's going on.
608608
uint32_t str_size;
609609
off_t str_off;
610-
struct backtrace_view syms_view;
610+
// NOTE: upstream doesn't have `{0}`, this is a fix for Rust issue #39468.
611+
// If syms_view is not initialized, then `free(syms_view.base)` may segfault later.
612+
struct backtrace_view syms_view = {0};
611613
off_t syms_off;
612614
size_t syms_size;
613615
int syms_view_valid;

0 commit comments

Comments
 (0)
Please sign in to comment.