libbacktrace patch committed: Fix setting str_size on PE/COFF

Message ID CAOyqgcXuLRFmzXEAxTBFAT+h6=7n_MHE2PE_HDGkFtyukHzkBg@mail.gmail.com
State New
Headers show
Series
  • libbacktrace patch committed: Fix setting str_size on PE/COFF
Related show

Commit Message

Ian Lance Taylor Jan. 25, 2018, 2:42 a.m.
This libbacktrace patch fixes the setting of str_size on PE/COFF to
not leave some bytes uninitialized on a 64-bit host.  Committed to
mainline.

Ian

2018-01-24  Ian Lance Taylor  <iant@golang.org>

* pecoff.c (coff_add): Use coff_read4, not memcpy.

Patch

Index: pecoff.c
===================================================================
--- pecoff.c	(revision 257038)
+++ pecoff.c	(working copy)
@@ -727,7 +727,7 @@  coff_add (struct backtrace_state *state,
 	goto fail;
       syms_view_valid = 1;
 
-      memcpy (&str_size, syms_view.data + syms_size, 4);
+      str_size = coff_read4 (syms_view.data + syms_size);
 
       str_off = syms_off + syms_size;